From 2a99fedc3845ef762647c5b140a286851b8b65bb Mon Sep 17 00:00:00 2001 From: Joe Wicentowski Date: Tue, 25 Jul 2023 12:22:03 -0400 Subject: [PATCH] Align file extensions with documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user documentation at https://eeditiones.github.io/tuttle-doc/getstarted/configuration/ states: > Tuttle is configured in modules/config.xqm in your Tuttle installation. This changes modules/config.xql to conform with the documentation’s filename. In the process, it applies the community file extensions to all XQuery modules in the repository - namely, .xq for main modules, and .xqm for library modules. It adjusts module prologs to use the updated location hints for module imports. Also, for consistency, it adds newlines to modules that lack them. --- README.md | 2 +- src/{controller.xql => controller.xq} | 6 +++--- src/modules/{api.xql => api.xq} | 8 ++++---- src/modules/{app.xql => app.xqm} | 4 ++-- src/modules/{config.xql => config.xqm} | 1 - src/modules/{github.xql => github.xqm} | 6 +++--- src/modules/{gitlab.xql => gitlab.xqm} | 6 +++--- src/modules/{testquery.xqm => testquery.xq} | 11 +++++------ src/{post-install.xql => post-install.xq} | 5 +---- src/repo.xml | 2 +- 10 files changed, 23 insertions(+), 28 deletions(-) rename src/{controller.xql => controller.xq} (97%) rename src/modules/{api.xql => api.xq} (99%) rename src/modules/{app.xql => app.xqm} (99%) rename src/modules/{config.xql => config.xqm} (99%) rename src/modules/{github.xql => github.xqm} (99%) rename src/modules/{gitlab.xql => gitlab.xqm} (99%) rename src/modules/{testquery.xqm => testquery.xq} (73%) rename src/{post-install.xql => post-install.xq} (67%) diff --git a/README.md b/README.md index 7fa866f..f3dce94 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ With incremental update only the changes to the database collection are applied. ### Lets start -1) customize the configuration (modules/config.xql) +1) customize the configuration (modules/config.xqm) 2) click on 'full' to trigger a full deployment from git to existdb 3) now you can update your collection with a click on 'incremental' diff --git a/src/controller.xql b/src/controller.xq similarity index 97% rename from src/controller.xql rename to src/controller.xq index 7a7280b..9d74067 100644 --- a/src/controller.xql +++ b/src/controller.xq @@ -12,7 +12,7 @@ if ($exist:path eq "") then -(: forward root path to index.xql :) +(: forward root path to index.html :) else if ($exist:path eq "/") then @@ -96,11 +96,11 @@ else if (starts-with($exist:path, '/jwt')) then (: all other requests are passed on the Open API router :) else - + - \ No newline at end of file + diff --git a/src/modules/api.xql b/src/modules/api.xq similarity index 99% rename from src/modules/api.xql rename to src/modules/api.xq index 1ffb468..3499455 100644 --- a/src/modules/api.xql +++ b/src/modules/api.xq @@ -9,10 +9,10 @@ import module namespace errors="http://e-editiones.org/roaster/errors"; import module namespace xmldb="http://exist-db.org/xquery/xmldb"; import module namespace compression="http://exist-db.org/xquery/compression"; -import module namespace github="http://exist-db.org/apps/tuttle/github" at "github.xql"; -import module namespace gitlab="http://exist-db.org/apps/tuttle/gitlab" at "gitlab.xql"; -import module namespace app="http://exist-db.org/apps/tuttle/app" at "app.xql"; -import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xql"; +import module namespace github="http://exist-db.org/apps/tuttle/github" at "github.xqm"; +import module namespace gitlab="http://exist-db.org/apps/tuttle/gitlab" at "gitlab.xqm"; +import module namespace app="http://exist-db.org/apps/tuttle/app" at "app.xqm"; +import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xqm"; (:~ diff --git a/src/modules/app.xql b/src/modules/app.xqm similarity index 99% rename from src/modules/app.xql rename to src/modules/app.xqm index 7370ee3..5c5268d 100644 --- a/src/modules/app.xql +++ b/src/modules/app.xqm @@ -9,7 +9,7 @@ import module namespace repo="http://exist-db.org/xquery/repo"; import module namespace sm="http://exist-db.org/xquery/securitymanager"; import module namespace dbutil="http://exist-db.org/xquery/dbutil"; -import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xql"; +import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xqm"; (:~ : Unzip helper function @@ -296,4 +296,4 @@ declare function app:write-sha($collection as xs:string, $git-sha as xs:string) let $sha := ''|| substring($git-sha, 1, 6) ||'' return xmldb:store($collection, $filename, $sha) -}; \ No newline at end of file +}; diff --git a/src/modules/config.xql b/src/modules/config.xqm similarity index 99% rename from src/modules/config.xql rename to src/modules/config.xqm index 72bdeae..4e11bc3 100644 --- a/src/modules/config.xql +++ b/src/modules/config.xqm @@ -101,4 +101,3 @@ declare function config:sm(){ "mode" : $sm/@mode/string() } }; - diff --git a/src/modules/github.xql b/src/modules/github.xqm similarity index 99% rename from src/modules/github.xql rename to src/modules/github.xqm index db94dbc..487537f 100644 --- a/src/modules/github.xql +++ b/src/modules/github.xqm @@ -6,8 +6,8 @@ import module namespace http="http://expath.org/ns/http-client"; import module namespace compression="http://exist-db.org/xquery/compression"; import module namespace crypto="http://expath.org/ns/crypto"; -import module namespace app="http://exist-db.org/apps/tuttle/app" at "app.xql"; -import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xql"; +import module namespace app="http://exist-db.org/apps/tuttle/app" at "app.xqm"; +import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xqm"; @@ -336,4 +336,4 @@ declare %private function github:request($url as xs:string, $token as xs:string) "_request": $request?status } } -}; \ No newline at end of file +}; diff --git a/src/modules/gitlab.xql b/src/modules/gitlab.xqm similarity index 99% rename from src/modules/gitlab.xql rename to src/modules/gitlab.xqm index a67c362..16f6bdf 100644 --- a/src/modules/gitlab.xql +++ b/src/modules/gitlab.xqm @@ -5,8 +5,8 @@ module namespace gitlab="http://exist-db.org/apps/tuttle/gitlab"; import module namespace http="http://expath.org/ns/http-client"; import module namespace compression="http://exist-db.org/xquery/compression"; -import module namespace app="http://exist-db.org/apps/tuttle/app" at "app.xql"; -import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xql"; +import module namespace app="http://exist-db.org/apps/tuttle/app" at "app.xqm"; +import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xqm"; (:~ @@ -325,4 +325,4 @@ declare %private function gitlab:request($url as xs:string, $token as xs:string) "_request": $request?status } } -}; \ No newline at end of file +}; diff --git a/src/modules/testquery.xqm b/src/modules/testquery.xq similarity index 73% rename from src/modules/testquery.xqm rename to src/modules/testquery.xq index dddf4bd..6e72754 100644 --- a/src/modules/testquery.xqm +++ b/src/modules/testquery.xq @@ -1,14 +1,13 @@ xquery version "3.1"; -import module namespace github="http://exist-db.org/apps/tuttle/github" at "github.xql"; -import module namespace app="http://exist-db.org/apps/tuttle/app" at "app.xql"; -import module namespace api="http://exist-db.org/apps/tuttle/api" at "api.xql"; -import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xql"; -import module namespace gitlab="http://exist-db.org/apps/tuttle/gitlab" at "gitlab.xql"; +import module namespace github="http://exist-db.org/apps/tuttle/github" at "github.xqm"; +import module namespace app="http://exist-db.org/apps/tuttle/app" at "app.xqm"; +import module namespace config="http://exist-db.org/apps/tuttle/config" at "config.xqm"; +import module namespace gitlab="http://exist-db.org/apps/tuttle/gitlab" at "gitlab.xqm"; let $git-collection := config:default-collection() let $config := config:collections($git-collection) let $url := $config?baseurl || "/projects/" || $config?project-id || "/repository/commits/" || "743dd6" ||"/diff" -return $url \ No newline at end of file +return $url diff --git a/src/post-install.xql b/src/post-install.xq similarity index 67% rename from src/post-install.xql rename to src/post-install.xq index 48534b4..87b1a80 100644 --- a/src/post-install.xql +++ b/src/post-install.xq @@ -1,9 +1,6 @@ xquery version "3.1"; -import module namespace api="http://exist-db.org/apps/tuttle/api" at "/db/apps/tuttle/modules/api.xql"; - declare namespace sm="http://exist-db.org/xquery/securitymanager"; -declare namespace appconf="http://www.bbaw.de/telota/software/ediarum/web/appconf"; (: The following external variables are set by the repo:deploy function :) @@ -14,5 +11,5 @@ declare variable $dir external; (: the target collection into which the app is deployed :) declare variable $target external; -sm:chmod(xs:anyURI($target||"/modules/api.xql"), "rwxr-sr-x"), +sm:chmod(xs:anyURI($target||"/modules/api.xq"), "rwxr-sr-x"), sm:chmod(xs:anyURI($target||"/data/tuttle.xml"), "rw-r-----") diff --git a/src/repo.xml b/src/repo.xml index 4c5f9d0..85e15d6 100644 --- a/src/repo.xml +++ b/src/repo.xml @@ -9,5 +9,5 @@ true application tuttle - post-install.xql + post-install.xq