From 43de036bd8e5aa7132d4a8655e23742657ba5702 Mon Sep 17 00:00:00 2001 From: Joe Wicentowski Date: Tue, 19 Dec 2023 11:31:39 -0500 Subject: [PATCH] Move inline programlistings into includes --- .../data/urlrewrite/listings/listing-14.xml | 1 + .../data/urlrewrite/listings/listing-15.xml | 3 +++ .../data/urlrewrite/listings/listing-16.xml | 5 ++++ .../data/urlrewrite/listings/listing-17.xml | 1 + .../data/urlrewrite/listings/listing-18.xml | 1 + .../data/urlrewrite/listings/listing-19.xml | 1 + .../data/urlrewrite/listings/listing-20.xml | 1 + .../data/urlrewrite/listings/listing-21.xml | 4 +++ .../data/urlrewrite/urlrewrite.xml | 25 ++++++------------- 9 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 src/main/xar-resources/data/urlrewrite/listings/listing-14.xml create mode 100644 src/main/xar-resources/data/urlrewrite/listings/listing-15.xml create mode 100644 src/main/xar-resources/data/urlrewrite/listings/listing-16.xml create mode 100644 src/main/xar-resources/data/urlrewrite/listings/listing-17.xml create mode 100644 src/main/xar-resources/data/urlrewrite/listings/listing-18.xml create mode 100644 src/main/xar-resources/data/urlrewrite/listings/listing-19.xml create mode 100644 src/main/xar-resources/data/urlrewrite/listings/listing-20.xml create mode 100644 src/main/xar-resources/data/urlrewrite/listings/listing-21.xml diff --git a/src/main/xar-resources/data/urlrewrite/listings/listing-14.xml b/src/main/xar-resources/data/urlrewrite/listings/listing-14.xml new file mode 100644 index 00000000..456d3570 --- /dev/null +++ b/src/main/xar-resources/data/urlrewrite/listings/listing-14.xml @@ -0,0 +1 @@ + diff --git a/src/main/xar-resources/data/urlrewrite/listings/listing-15.xml b/src/main/xar-resources/data/urlrewrite/listings/listing-15.xml new file mode 100644 index 00000000..0e972391 --- /dev/null +++ b/src/main/xar-resources/data/urlrewrite/listings/listing-15.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/main/xar-resources/data/urlrewrite/listings/listing-16.xml b/src/main/xar-resources/data/urlrewrite/listings/listing-16.xml new file mode 100644 index 00000000..95d9ff96 --- /dev/null +++ b/src/main/xar-resources/data/urlrewrite/listings/listing-16.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/xar-resources/data/urlrewrite/listings/listing-17.xml b/src/main/xar-resources/data/urlrewrite/listings/listing-17.xml new file mode 100644 index 00000000..6308dc56 --- /dev/null +++ b/src/main/xar-resources/data/urlrewrite/listings/listing-17.xml @@ -0,0 +1 @@ + diff --git a/src/main/xar-resources/data/urlrewrite/listings/listing-18.xml b/src/main/xar-resources/data/urlrewrite/listings/listing-18.xml new file mode 100644 index 00000000..ea6b535a --- /dev/null +++ b/src/main/xar-resources/data/urlrewrite/listings/listing-18.xml @@ -0,0 +1 @@ + diff --git a/src/main/xar-resources/data/urlrewrite/listings/listing-19.xml b/src/main/xar-resources/data/urlrewrite/listings/listing-19.xml new file mode 100644 index 00000000..b1362e8a --- /dev/null +++ b/src/main/xar-resources/data/urlrewrite/listings/listing-19.xml @@ -0,0 +1 @@ + diff --git a/src/main/xar-resources/data/urlrewrite/listings/listing-20.xml b/src/main/xar-resources/data/urlrewrite/listings/listing-20.xml new file mode 100644 index 00000000..5f8ce2f5 --- /dev/null +++ b/src/main/xar-resources/data/urlrewrite/listings/listing-20.xml @@ -0,0 +1 @@ + diff --git a/src/main/xar-resources/data/urlrewrite/listings/listing-21.xml b/src/main/xar-resources/data/urlrewrite/listings/listing-21.xml new file mode 100644 index 00000000..310fc4a5 --- /dev/null +++ b/src/main/xar-resources/data/urlrewrite/listings/listing-21.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/main/xar-resources/data/urlrewrite/urlrewrite.xml b/src/main/xar-resources/data/urlrewrite/urlrewrite.xml index aeeff9ef..585a3107 100644 --- a/src/main/xar-resources/data/urlrewrite/urlrewrite.xml +++ b/src/main/xar-resources/data/urlrewrite/urlrewrite.xml @@ -131,7 +131,7 @@ useful for requests to fixed resources like images or stylesheets. An alternative may be to handle requests for such resources separately from the XQueryUrlRewrite servlet; this is discussed in . - <ignore xmlns="http://exist.sourceforge.net/NS/exist"/> + The ignore element may include an optional cache-control element. @@ -143,9 +143,7 @@ request, and this can potentially trigger the controller again; care must be taken to avoid creaing an un-exitable loop. The URL to the redirect element is given in an attribute named url. - <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> - <redirect url="..."/> -</dispatch> + A redirect will be visible to the user: for instance the user's web-browser will be updated to show the specified new URL. @@ -205,11 +203,7 @@ - <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> - <forward url="{$exist:controller}/modules/transform.xq"> - <add-parameter name="doc" value="{$exist:resource}.xml"/> - </forward> -</dispatch> + The forward element can contain the optional child elements: add-parameter, set-attribute, The name of the parameter is taken from the name attribute, and the value from the value attribute. - <add-parameter name="xxx" value="yyy"/> + The original HTTP request will be copied before the change is applied. This applies only to the step on which it is placed, that is to say that subsequent steps in the pipeline will not see the parameter. @@ -242,7 +236,7 @@ they and are not related to the HTTP Request or HTTP Response. The name of the request attribute is read from the name attribute, and the value from the value attribute. - <set-attribute name="xxx" value="yyy"/> + You can set arbitrary request attributes, for instance to pass information between XQuery modules. Some attribute names may be reserved by various servlets in the pipeline. @@ -251,7 +245,7 @@ The clear-attribute option clears a request attribute. The name of the request attribute is read from the name attribute. - <clear-attribute name="xxx"/> + Unlike parameters, request attributes will be visible to subsequent steps in the processing pipeline. They only need to be explicitly cleared once they are no longer needed by the user. eXist-db places no requirement on the user having to ever clear the @@ -260,7 +254,7 @@ The set-header option sets an HTTP Response Header field. The name of the header is read from the name attribute, and the value from the value attribute. - <set-header name="xxx" value="yyy"/> + The HTTP response is shared between all steps in the pipeline, so all following steps will be able to see the change. The <tag>cache-control</tag> Option @@ -270,10 +264,7 @@ Internally the URL Rewriting framework maintains a mapping between Input URLs and Dispatch Rules. When the cache is enabled, the controller.xq XQuery Main Module only needs to be executed once for each distinct input URL. Subsequent requests for the same URL will be served from the cache. - <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> - <redirect url="..."/> - <cache-control cache="yes"/> -</dispatch> + Note: only the URL rewrite rule is cached, the HTTP response itself is not cached! The cache-control setting is unrelated to any HTTP Cache Headers in the HTTP Response, and is unrelated to any client-side caching within a web-browser.