Skip to content

Commit 430bc37

Browse files
authored
Merge pull request #906 from joewiz/url-rewrite-edits
[urlrewrite] Minor edits
2 parents e449ef5 + e7e23d2 commit 430bc37

File tree

8 files changed

+426
-317
lines changed

8 files changed

+426
-317
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
xquery version "3.1";
22

3-
declare namespace exist = "http://exist.sourceforge.net/NS/exist";
3+
declare namespace exist="http://exist.sourceforge.net/NS/exist";
44

55
declare variable $exist:path external;
66
declare variable $exist:resource external;
@@ -9,7 +9,7 @@ declare variable $exist:prefix external;
99
declare variable $exist:root external;
1010

1111
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
12-
<forward url="{$exist:controller}/modules/transform.xq">
13-
<add-parameter name="doc" value="{$exist:resource}.xml"/>
14-
</forward>
12+
<forward url="{$exist:controller}/modules/transform.xq">
13+
<add-parameter name="doc" value="{$exist:resource}.xml"/>
14+
</forward>
1515
</dispatch>
Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
if (starts-with($path, '/sandbox/execute'))
2-
then
3-
let $query := request:get-parameter("qu", ())
4-
let $startTime := util:system-time()
5-
return
6-
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
7-
<!-- Query is executed by XQueryServlet -->
8-
<forward servlet="XQueryServlet">
9-
<!-- Query is passed via the attribute 'xquery.source' -->
10-
<set-attribute name="xquery.source" value="{$query}"/>
11-
<!-- Results should be written into attribute 'results' -->
12-
<set-attribute name="xquery.attribute" value="results"/>
13-
<!-- Errors should be passed through instead of terminating the request -->
14-
<set-attribute name="xquery.report-errors" value="yes"/>
15-
</forward>
16-
<view>
17-
<!-- Post process the result: store it into the HTTP session and return the number of hits only. -->
18-
<forward url="session.xq">
19-
<clear-attribute name="xquery.source"/>
20-
<clear-attribute name="xquery.attribute"/>
21-
<set-attribute name="elapsed" value="{string(seconds-from-duration(util:system-time() - $startTime))}"/>
22-
</forward>
23-
</view>
24-
</dispatch>
25-
else if (starts-with($path, '/sandbox/results/'))
1+
if (starts-with($path, "/eXide/execute"))
262
then
3+
let $query := request:get-parameter("qu", ())
4+
let $startTime := util:system-time()
5+
return
6+
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
7+
<!-- Query is executed by XQueryServlet -->
8+
<forward servlet="XQueryServlet">
9+
<!-- Query is passed via the attribute "xquery.source" -->
10+
<set-attribute name="xquery.source" value="{$query}"/>
11+
<!-- Results should be written into attribute "results" -->
12+
<set-attribute name="xquery.attribute" value="results"/>
13+
<!-- Errors should be passed through instead of terminating the request -->
14+
<set-attribute name="xquery.report-errors" value="yes"/>
15+
</forward>
16+
<view>
17+
<!-- Post process the result: store it into the HTTP session and return the number of hits only. -->
18+
<forward url="session.xq">
19+
<clear-attribute name="xquery.source"/>
20+
<clear-attribute name="xquery.attribute"/>
21+
<set-attribute name="elapsed" value="{string(seconds-from-duration(util:system-time() - $startTime))}"/>
22+
</forward>
23+
</view>
24+
</dispatch>
25+
else
26+
if (starts-with($path, "/sandbox/results/"))
27+
then
2728
(: Retrieve an item from the query results stored in the HTTP session. The
2829
format of the URL will be /sandbox/results/X, where X is the number of the
2930
item in the result set :)
3031
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
31-
<forward url="../session.xq">
32-
<add-parameter name="num" value="{$name}"/>
33-
</forward>
34-
</dispatch>
32+
<forward url="../session.xq">
33+
<add-parameter name="num" value="{$name}"/>
34+
</forward>
35+
</dispatch>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<clear-attribute name="xxx">
1+
<clear-attribute name="xxx"/>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
xquery version "3.1";
22

3-
declare namespace exist = "http://exist.sourceforge.net/NS/exist";
3+
declare namespace exist="http://exist.sourceforge.net/NS/exist";
44

55
declare variable $exist:path external;
66
declare variable $exist:resource external;
@@ -9,8 +9,8 @@ declare variable $exist:prefix external;
99
declare variable $exist:root external;
1010

1111
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
12-
<forward url="data/{$exist:resource}.xml"/>
13-
<view>
14-
<forward url="{$exist:controller}/modules/transform.xq"/>
15-
</view>
12+
<forward url="data/{$exist:resource}.xml"/>
13+
<view>
14+
<forward url="{$exist:controller}/modules/transform.xq"/>
15+
</view>
1616
</dispatch>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
2+
<redirect url="..."/>
3+
</dispatch>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if ($exist:path eq '/') then
2-
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
3-
<redirect url="index.xml"/>
4-
</dispatch>
1+
if ($exist:path eq "/") then
2+
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
3+
<redirect url="index.xml"/>
4+
</dispatch>
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
<!--
2-
Default configuration: main web application is served from the
3-
webapp directory.
1+
<!-- HTTP requests to /apps are mapped onto the database path /db/apps -->
2+
<root pattern="/apps" path="xmldb:exist:///db/apps"/>
3+
4+
<!--
5+
++ The default fallback web application is served from the
6+
++ /etc/webapp directory on the filesystem.
47
-->
5-
<root pattern="/tools" path="xmldb:exist:///db/www"/>
68
<root pattern=".*" path="/"/>

0 commit comments

Comments
 (0)