Skip to content

Commit 7b54c95

Browse files
committed
feat: adopt community convention for XQuery files
extend community convention for XQuery modules to all files in Jinks
1 parent eaa646c commit 7b54c95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+125
-125
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ The extension process works as follows:
3232
1. jinks creates a merged configuration, assembled from the configurations of all profiles in the extension hierarchy
3333
2. it calls the *write action* on every profile in sequence
3434

35-
### `setup.xql`
35+
### `setup.xqm`
3636

37-
The profile may also include an XQuery module called `setup.xql`. If present, jinks will inspect the functions defined in this module, searching for functions with the annotations `%generator:prepare` and `%generator:write`. They represent different stages in the generation process:
37+
The profile may also include an XQuery module called `setup.xqm`. If present, jinks will inspect the functions defined in this module, searching for functions with the annotations `%generator:prepare` and `%generator:write`. They represent different stages in the generation process:
3838

3939
* `%generator:prepare`: receives the merged configuration map - including all changes applied by previous calls to prepare - and may return a modified map. Use this to compute and set custom properties needed by your profile
4040
* `%generator:write`: performs the actual installation
@@ -44,7 +44,7 @@ The profile may also include an XQuery module called `setup.xql`. If present, ji
4444

4545
`%generator:after-write` receives the target collection in which the application is installed as first parameter, the current context as second.
4646

47-
If no `setup.xql` is present or no `%generator:write` function is defined, the default action is to call
47+
If no `setup.xqm` is present or no `%generator:write` function is defined, the default action is to call
4848

4949
```xquery
5050
cpy:copy-collection($context)
@@ -66,7 +66,7 @@ Convenient configuration forms will be added later once the basic profiles reach
6666

6767
After installing the jinks application package via the dashboard, open http://localhost:8080/exist/apps/tei-publisher-jinks/api.html in your browser. The `/api/generator/{profile}` provides the main API entry point.
6868

69-
The main entry point into jinks is provided by the module [`modules/generator.xql`](modules/generator.xql), which exposes the function:
69+
The main entry point into jinks is provided by the module [`modules/generator.xqm`](modules/generator.xqm), which exposes the function:
7070

7171
```xquery
7272
declare function generator:process($profile as xs:string, $settings as map(*)?, $config as map(*)?)

controller.xq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if ($exist:path eq '') then
1414
</dispatch>
1515

1616
else if ($exist:path eq "/") then
17-
(: forward root path to index.xql :)
17+
(: forward root path to index.html :)
1818
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
1919
<redirect url="index.html"/>
2020
</dispatch>

pages/demo/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer style="border-top: 1px solid #a0a0a0; margin-top: 1rem;">
2-
[% import "https://tei-publisher.com/generator/xquery/config" as "config" at "modules/config.xql" %]
2+
[% import "https://tei-publisher.com/generator/xquery/config" as "config" at "modules/config.xqm" %]
33
<p>Generated by [[$context?app]] running on [[system:get-product-name()]] v[[system:get-version()]].
44
Context path: [[$config:context-path]].</p>
55
[% block copyright %][% endblock %]

pages/demo/sample-templates.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
{
6868
"description": "Using imported module functions",
69-
"template": "[% import \"https://tei-publisher.com/jinks/xquery/demo\" as \"demo\" at \"modules/demo.xql\" %]\n\n[# call function in imported demo module #]\n<section>[[demo:sysinfo($title)]]</section>",
69+
"template": "[% import \"https://tei-publisher.com/jinks/xquery/demo\" as \"demo\" at \"modules/demo.xqm\" %]\n\n[# call function in imported demo module #]\n<section>[[demo:sysinfo($title)]]</section>",
7070
"params": {
7171
"title": "My great new application"
7272
},
@@ -88,7 +88,7 @@
8888
},
8989
{
9090
"description": "Other templating parameters in frontmatter",
91-
"template": "---json\n{\n \"templating\": {\n \"extends\": \"pages/demo/base.html\",\n \"namespaces\": {\n \"tei\": \"http://www.tei-c.org/ns/1.0\"\n },\n \"modules\": {\n \"https://tei-publisher.com/jinks/xquery/demo\": {\n \"prefix\": \"demo\",\n \"at\": \"modules/demo.xql\"\n }\n }\n },\n \"author\": \"Heinz\"\n}\n---\n\n[% let $data = demo:tei() %]\n<h1>[[ $data//tei:title/text() ]]</h1>\n\n<p>[[ $data//tei:body/tei:p/text() ]]</p>\n\n<footer>Published [[format-date(current-dateTime(), \"[MNn] [D], [Y]\", \"en\", (), ())]] by [[$author]].</footer>\n[% endlet %]",
91+
"template": "---json\n{\n \"templating\": {\n \"extends\": \"pages/demo/base.html\",\n \"namespaces\": {\n \"tei\": \"http://www.tei-c.org/ns/1.0\"\n },\n \"modules\": {\n \"https://tei-publisher.com/jinks/xquery/demo\": {\n \"prefix\": \"demo\",\n \"at\": \"modules/demo.xqm\"\n }\n }\n },\n \"author\": \"Heinz\"\n}\n---\n\n[% let $data = demo:tei() %]\n<h1>[[ $data//tei:title/text() ]]</h1>\n\n<p>[[ $data//tei:body/tei:p/text() ]]</p>\n\n<footer>Published [[format-date(current-dateTime(), \"[MNn] [D], [Y]\", \"en\", (), ())]] by [[$author]].</footer>\n[% endlet %]",
9292
"params": {
9393
"author": "Rudi"
9494
},

pages/profile-documentation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ <h3>Open API endpoint definitions</h3>
147147
</article>
148148
[% endif %]
149149

150-
[% let $files = tu:scan-collection($path || "/modules", "^.*\.xql$") %]
150+
[% let $files = tu:scan-collection($path || "/modules", "^.*\.xqm?$") %]
151151
[% if exists($files) %]
152152
<article>
153153
<h3>XQuery Modules</h3>

profiles/annotate/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{
2727
"prefix": "anno",
2828
"id": "http://teipublisher.com/api/annotations",
29-
"path": "annotations/annotations.xql",
29+
"path": "annotations/annotations.xqm",
3030
"spec": "annotations/api.json"
3131
}
3232
]

profiles/base10/collection.tpl.xconf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<index xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dbk="http://docbook.org/ns/docbook">
33
<fulltext default="none" attributes="false"/>
44
<lucene>
5-
<module uri="http://teipublisher.com/index" prefix="nav" at="index.xql"/>
5+
<module uri="http://teipublisher.com/index" prefix="nav" at="index.xqm"/>
66
<analyzer class="org.exist.indexing.lucene.analyzers.NoDiacriticsStandardAnalyzer">
77
<param name="stopwords" type="org.apache.lucene.analysis.util.CharArraySet"/>
88
</analyzer>

profiles/base10/controller.tpl.xql renamed to profiles/base10/controller.tpl.xq

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if ($exist:path eq '') then
3737
</dispatch>
3838

3939
else if ($exist:path eq "/") then
40-
(: forward root path to index.xql :)
40+
(: forward root path to landing page :)
4141
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
4242
<redirect url="{$landingPage}"/>
4343
</dispatch>
@@ -79,11 +79,11 @@ else if (matches($exist:resource, "\.(png|jpg|jpeg|gif|tif|tiff|txt|mei)$", "s")
7979
else
8080
let $main :=
8181
if (matches($exist:path, "^/+api/+(?:odd|lint)")) then
82-
"api-odd.xql"
82+
"api-odd.xq"
8383
else if (matches($exist:path, "/+tex$") or matches($exist:path, "/+api/+(?:actions/reindex)$")) then
84-
"api-dba.xql"
84+
"api-dba.xq"
8585
else
86-
"api.xql"
86+
"api.xq"
8787
return
8888
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
8989
<forward url="{$exist:controller}/modules/lib/{$main}">
File renamed without changes.

0 commit comments

Comments
 (0)