-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #906 from joewiz/url-rewrite-edits
[urlrewrite] Minor edits
- Loading branch information
Showing
8 changed files
with
426 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 30 additions & 29 deletions
59
src/main/xar-resources/data/urlrewrite/listings/listing-11.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
if (starts-with($path, '/sandbox/execute')) | ||
then | ||
let $query := request:get-parameter("qu", ()) | ||
let $startTime := util:system-time() | ||
return | ||
<dispatch xmlns="http://exist.sourceforge.net/NS/exist"> | ||
<!-- Query is executed by XQueryServlet --> | ||
<forward servlet="XQueryServlet"> | ||
<!-- Query is passed via the attribute 'xquery.source' --> | ||
<set-attribute name="xquery.source" value="{$query}"/> | ||
<!-- Results should be written into attribute 'results' --> | ||
<set-attribute name="xquery.attribute" value="results"/> | ||
<!-- Errors should be passed through instead of terminating the request --> | ||
<set-attribute name="xquery.report-errors" value="yes"/> | ||
</forward> | ||
<view> | ||
<!-- Post process the result: store it into the HTTP session and return the number of hits only. --> | ||
<forward url="session.xq"> | ||
<clear-attribute name="xquery.source"/> | ||
<clear-attribute name="xquery.attribute"/> | ||
<set-attribute name="elapsed" value="{string(seconds-from-duration(util:system-time() - $startTime))}"/> | ||
</forward> | ||
</view> | ||
</dispatch> | ||
else if (starts-with($path, '/sandbox/results/')) | ||
if (starts-with($path, "/eXide/execute")) | ||
then | ||
let $query := request:get-parameter("qu", ()) | ||
let $startTime := util:system-time() | ||
return | ||
<dispatch xmlns="http://exist.sourceforge.net/NS/exist"> | ||
<!-- Query is executed by XQueryServlet --> | ||
<forward servlet="XQueryServlet"> | ||
<!-- Query is passed via the attribute "xquery.source" --> | ||
<set-attribute name="xquery.source" value="{$query}"/> | ||
<!-- Results should be written into attribute "results" --> | ||
<set-attribute name="xquery.attribute" value="results"/> | ||
<!-- Errors should be passed through instead of terminating the request --> | ||
<set-attribute name="xquery.report-errors" value="yes"/> | ||
</forward> | ||
<view> | ||
<!-- Post process the result: store it into the HTTP session and return the number of hits only. --> | ||
<forward url="session.xq"> | ||
<clear-attribute name="xquery.source"/> | ||
<clear-attribute name="xquery.attribute"/> | ||
<set-attribute name="elapsed" value="{string(seconds-from-duration(util:system-time() - $startTime))}"/> | ||
</forward> | ||
</view> | ||
</dispatch> | ||
else | ||
if (starts-with($path, "/sandbox/results/")) | ||
then | ||
(: Retrieve an item from the query results stored in the HTTP session. The | ||
format of the URL will be /sandbox/results/X, where X is the number of the | ||
item in the result set :) | ||
<dispatch xmlns="http://exist.sourceforge.net/NS/exist"> | ||
<forward url="../session.xq"> | ||
<add-parameter name="num" value="{$name}"/> | ||
</forward> | ||
</dispatch> | ||
<forward url="../session.xq"> | ||
<add-parameter name="num" value="{$name}"/> | ||
</forward> | ||
</dispatch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<clear-attribute name="xxx"> | ||
<clear-attribute name="xxx"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/main/xar-resources/data/urlrewrite/listings/listing-22.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<dispatch xmlns="http://exist.sourceforge.net/NS/exist"> | ||
<redirect url="..."/> | ||
</dispatch> |
8 changes: 4 additions & 4 deletions
8
src/main/xar-resources/data/urlrewrite/listings/listing-3.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
if ($exist:path eq '/') then | ||
<dispatch xmlns="http://exist.sourceforge.net/NS/exist"> | ||
<redirect url="index.xml"/> | ||
</dispatch> | ||
if ($exist:path eq "/") then | ||
<dispatch xmlns="http://exist.sourceforge.net/NS/exist"> | ||
<redirect url="index.xml"/> | ||
</dispatch> |
10 changes: 6 additions & 4 deletions
10
src/main/xar-resources/data/urlrewrite/listings/listing-7.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<!-- | ||
Default configuration: main web application is served from the | ||
webapp directory. | ||
<!-- HTTP requests to /apps are mapped onto the database path /db/apps --> | ||
<root pattern="/apps" path="xmldb:exist:///db/apps"/> | ||
|
||
<!-- | ||
++ The default fallback web application is served from the | ||
++ /etc/webapp directory on the filesystem. | ||
--> | ||
<root pattern="/tools" path="xmldb:exist:///db/www"/> | ||
<root pattern=".*" path="/"/> |
Oops, something went wrong.