This repository has been archived by the owner on Mar 16, 2022. It is now read-only.
/
config.xqy
102 lines (90 loc) · 3.3 KB
/
config.xqy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
(:
Copyright 2012 MarkLogic Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
:)
xquery version "1.0-ml";
module namespace c = "http://marklogic.com/roxy/config";
import module namespace def = "http://marklogic.com/roxy/defaults" at "/roxy/config/defaults.xqy";
declare namespace rest = "http://marklogic.com/appservices/rest";
(:
: ***********************************************
: Overrides for the Default Roxy control options
:
: See /roxy/config/defaults.xqy for the complete list of stuff that you can override.
: Roxy will check this file (config.xqy) first. If no overrides are provided then it will use the defaults.
:
: Go to https://github.com/marklogic/roxy/wiki/Overriding-Roxy-Options for more details
:
: ***********************************************
:)
declare variable $c:ROXY-OPTIONS :=
<options>
<layouts>
<layout format="html">two-column</layout>
</layouts>
</options>;
(:
: ***********************************************
: Overrides for the Default Roxy scheme
:
: See /roxy/config/defaults.xqy for the default routes
: Roxy will check this file (config.xqy) first. If no overrides are provided then it will use the defaults.
:
: Go to https://github.com/marklogic/roxy/wiki/Roxy-URL-Rewriting for more details
:
: ***********************************************
:)
declare variable $c:ROXY-ROUTES :=
<routes xmlns="http://marklogic.com/appservices/rest">
<request uri="^/$" endpoint="/roxy/query-router.xqy">
<uri-param name="controller">mljstest</uri-param>
<uri-param name="func">main</uri-param>
<uri-param name="format">html</uri-param>
<http method="GET"/>
<http method="HEAD"/>
</request>
<request uri="^/my/awesome/route" />
{
$def:ROXY-ROUTES/rest:request
}
</routes>;
(:
: ***********************************************
: A decent place to put your appservices search config
: and various other search options.
: The examples below are used by the appbuilder style
: default application.
: ***********************************************
:)
declare variable $c:DEFAULT-PAGE-LENGTH as xs:int := 5;
declare variable $c:SEARCH-OPTIONS :=
<options xmlns="http://marklogic.com/appservices/search">
<search-option>unfiltered</search-option>
<term>
<term-option>case-insensitive</term-option>
</term>
<constraint name="facet1">
<collection>
<facet-option>limit=10</facet-option>
</collection>
</constraint>
<return-results>true</return-results>
<return-query>true</return-query>
</options>;
(:
: Labels are used by appbuilder faceting code to provide internationalization
:)
declare variable $c:LABELS :=
<labels xmlns="http://marklogic.com/xqutils/labels">
<label key="facet1">
<value xml:lang="en">Sample Facet</value>
</label>
</labels>;