Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align file extensions with documentation #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
6 changes: 3 additions & 3 deletions src/controller.xql → src/controller.xq
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if ($exist:path eq "") then
<redirect url="{request:get-uri()}/"/>
</dispatch>

(: forward root path to index.xql :)
(: forward root path to index.html :)
else if ($exist:path eq "/") then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="index.html"/>
Expand Down Expand Up @@ -96,11 +96,11 @@ else if (starts-with($exist:path, '/jwt')) then
(: all other requests are passed on the Open API router :)
else
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}/modules/api.xql">
<forward url="{$exist:controller}/modules/api.xq">
<set-header name="Access-Control-Allow-Origin" value="*"/>
<set-header name="Access-Control-Allow-Credentials" value="true"/>
<set-header name="Access-Control-Allow-Methods" value="GET, POST, DELETE, PUT, PATCH, OPTIONS"/>
<set-header name="Access-Control-Allow-Headers" value="Accept, Content-Type, Authorization, X-Start"/>
<set-header name="Cache-Control" value="no-cache"/>
</forward>
</dispatch>
</dispatch>
8 changes: 4 additions & 4 deletions src/modules/api.xql → src/modules/api.xq
Original file line number Diff line number Diff line change
Expand Up @@ -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";


(:~
Expand Down
4 changes: 2 additions & 2 deletions src/modules/app.xql → src/modules/app.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -296,4 +296,4 @@ declare function app:write-sha($collection as xs:string, $git-sha as xs:string)
let $sha := '<hash><value>'|| substring($git-sha, 1, 6) ||'</value></hash>'

return xmldb:store($collection, $filename, $sha)
};
};
1 change: 0 additions & 1 deletion src/modules/config.xql → src/modules/config.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ declare function config:sm(){
"mode" : $sm/@mode/string()
}
};

6 changes: 3 additions & 3 deletions src/modules/github.xql → src/modules/github.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -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";



Expand Down Expand Up @@ -336,4 +336,4 @@ declare %private function github:request($url as xs:string, $token as xs:string)
"_request": $request?status
}
}
};
};
6 changes: 3 additions & 3 deletions src/modules/gitlab.xql → src/modules/gitlab.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -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";


(:~
Expand Down Expand Up @@ -325,4 +325,4 @@ declare %private function gitlab:request($url as xs:string, $token as xs:string)
"_request": $request?status
}
}
};
};
11 changes: 5 additions & 6 deletions src/modules/testquery.xqm → src/modules/testquery.xq
Original file line number Diff line number Diff line change
@@ -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
return $url
5 changes: 1 addition & 4 deletions src/post-install.xql → src/post-install.xq
Original file line number Diff line number Diff line change
@@ -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 :)

Expand All @@ -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-----")
2 changes: 1 addition & 1 deletion src/repo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
<copyright>true</copyright>
<type>application</type>
<target>tuttle</target>
<finish>post-install.xql</finish>
<finish>post-install.xq</finish>
</meta>