Skip to content

Commit 576c9bb

Browse files
authored
Merge pull request #596 from adamretter/controller.xq
URL Rewrite should now use controller.xq and not controller.xql
2 parents 74f91d5 + 603692c commit 576c9bb

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/main/xar-resources/data/development-starter/development-starter.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
</listitem>
268268
</varlistentry>
269269
<varlistentry>
270-
<term><code>controller.xql</code></term>
270+
<term><code>controller.xq</code></term>
271271
<listitem>
272272
<para>The URL rewriting controller, which handles the URL handling of the
273273
application. You will rarely need to change this for simple
@@ -319,7 +319,7 @@
319319
<literal>index.html</literal> page, you'll see it is just an HTML div defining the
320320
actual content body. The rest of the page is dragged in from the page template residing
321321
in <literal>templates/page.html</literal>.</para>
322-
<para>The <literal>controller.xql</literal> is configured to call the HTML Templating for
322+
<para>The <literal>controller.xq</literal> is configured to call the HTML Templating for
323323
every URL ending with <literal>.html</literal>. The process flow for an arbitrary
324324
<literal>.html</literal> file is shown below:</para>
325325
<figure>

src/main/xar-resources/data/templating/listings/listing-12.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(:~
2-
: This is the main XQuery which will (by default) be called by controller.xql
2+
: This is the main XQuery which will (by default) be called by controller.xq
33
: to process any URI ending with ".html". It receives the HTML from
44
: the controller and passes it to the templating framework.
55
:)
@@ -34,4 +34,4 @@ let $lookup := function($functionName as xs:string, $arity as xs:int) {
3434
:)
3535
let $content := request:get-data()
3636
return
37-
templates:apply($content, $lookup, ())
37+
templates:apply($content, $lookup, ())

src/main/xar-resources/data/templating/templating.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
as follows:</para>
251251
<programlisting language="xquery" xlink:href="listings/listing-12.txt"/>
252252
<para>This module would be called from the URL rewriting controller. For example, we could
253-
add a rule to <literal>controller.xql</literal> to pass any .html resource to the above
253+
add a rule to <literal>controller.xq</literal> to pass any .html resource to the above
254254
main query (saved to <literal>modules/view.xql</literal>):</para>
255255
<programlisting language="xquery" xlink:href="listings/listing-13.txt"/>
256256
<para>The only part of the main module code which might look a bit unusual is the inline

src/main/xar-resources/data/urlrewrite/urlrewrite.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<para>If no action is specified within the dispatch element, the request will be passed through the filter chain and handled normally. The same happens if the action is the
6969
<tag>ignore</tag>
7070
element. For example, the simplest controller script consist of a single ignore:</para>
71-
<para>eXist's URL rewriting mechanism lets you specify an <tag>error handler</tag> element for each dispatch directive in your <literal>controller.xql</literal>.</para>
71+
<para>eXist's URL rewriting mechanism lets you specify an <tag>error handler</tag> element for each dispatch directive in your <literal>controller.xq</literal>. <emphasis>NOTE</emphasis>: In eXist-db versions prior to 5.3.0, <literal>controller.xql</literal> must be used instead.</para>
7272
<programlisting language="xml" xlink:href="listings/listing-4.xml"/>
7373

7474
<note>
@@ -87,7 +87,7 @@
8787
<title>Variables</title>
8888

8989
<para>Within a
90-
<code>controller.xql</code>
90+
<code>controller.xq</code>
9191
file, you have access to the entire XQuery function library, including the functions in the
9292
<code>request</code>,
9393
<code>response</code>
@@ -253,7 +253,7 @@
253253
<title>Locating Controller Scripts and Configuring Base Mappings</title>
254254

255255
<para>By convention, the controller XQueries are called
256-
<literal>controller.xql</literal>.</para>
256+
<literal>controller.xq</literal>.</para>
257257
<para>
258258
<code>XQueryURLRewrite</code>
259259
will try to guess the path to the controller by looking at the request path.
@@ -288,7 +288,7 @@
288288
<literal>/rest</literal>
289289
in
290290
<literal>web.xml</literal>, we would need to make sure that this path is ignored in our main
291-
<literal>controller.xql</literal>. However, if the mapping is done via
291+
<literal>controller.xq</literal>. However, if the mapping is done via
292292
<literal>controller-config.xml</literal>, it will already been known to XQueryURLRewrite and we don't need take care of the path in our controller.</para>
293293
<para>The
294294
<tag>root</tag>
@@ -338,7 +338,7 @@
338338
<literal>webapp/stylesheets/db2html.xsl</literal>. This can be done by returning the following
339339
<tag>dispatch</tag>
340340
fragment by
341-
<literal>controller.xql</literal>:</para>
341+
<literal>controller.xq</literal>:</para>
342342
<programlisting language="xml" xlink:href="listings/listing-9.xml"/>
343343
<para>In this example there's no forwarding action except for the view So the request will be handled by the servlet engine the normal way. The response is then passed to
344344
<code>XSLTServlet</code>. A new HTTP POST request is created whose body is set to the response data of the previous step.
@@ -561,7 +561,7 @@
561561
<title>Accessing resources not stored in the database</title>
562562

563563
<para>If your
564-
<code>controller.xql</code>
564+
<code>controller.xq</code>
565565
is stored in a database collection, all relative and/or absolute URIs within the controller will be resolved against the database, not the file system. This can be a problem if you need to access common resources, which should be shared with other
566566
applications residing on the file system or in the database.</para>
567567
<para>The

0 commit comments

Comments
 (0)