Skip to content

Commit

Permalink
Adopt community XQuery file extension convention
Browse files Browse the repository at this point in the history
- main modules: .xq
- library modules: .xqm
  • Loading branch information
joewiz committed May 2, 2022
1 parent 004e191 commit 0aa5488
Show file tree
Hide file tree
Showing 36 changed files with 50 additions and 51 deletions.
16 changes: 8 additions & 8 deletions controller.xql → controller.xq
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ else if (starts-with($exist:path, "/store/")) then
let $resource := substring-after($exist:path, "/store")
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}/modules/store.xql">
<forward url="{$exist:controller}/modules/store.xq">
<add-parameter name="path" value="{$resource}"/>
{$login("org.exist.login", (), false())}
</forward>
Expand All @@ -130,7 +130,7 @@ else if (starts-with($exist:path, "/check/")) then
let $resource := substring-after($exist:path, "/validate")
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}/modules/validate-xml.xql">
<forward url="{$exist:controller}/modules/validate-xml.xq">
<add-parameter name="validate" value="no"/>
{$login("org.exist.login", (), false())}
</forward>
Expand All @@ -140,7 +140,7 @@ else if ($exist:resource = "index.html") then
if (local:user-allowed()) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<view>
<forward url="modules/view.xql">
<forward url="modules/view.xq">
<set-header name="Cache-Control" value="max-age=3600"/>
</forward>
</view>
Expand Down Expand Up @@ -187,7 +187,7 @@ else if ($exist:resource eq 'execute') then
<view>
<!-- Post process the result: store it into the HTTP session
and return the number of hits only. -->
<forward url="modules/session.xql">
<forward url="modules/session.xq">
<clear-attribute name="xquery.source"/>
<clear-attribute name="xquery.attribute"/>
<set-attribute name="elapsed"
Expand Down Expand Up @@ -217,7 +217,7 @@ else if ($exist:resource eq 'execute') then
: item in the result set :)
else if (starts-with($exist:path, '/results/')) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="../modules/session.xql">
<forward url="../modules/session.xq">
{$login("org.exist.login", (), false())}
<set-header name="Cache-Control" value="no-cache"/>
<add-parameter name="num" value="{$exist:resource}"/>
Expand All @@ -230,7 +230,7 @@ else if ($exist:resource eq "outline") then
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<!-- Query is executed by XQueryServlet -->
<forward url="modules/outline.xql">
<forward url="modules/outline.xq">
{$login("org.exist.login", (), false())}
<set-header name="Cache-Control" value="no-cache"/>
<set-attribute name="xquery.module-load-path" value="{$base}"/>
Expand All @@ -240,13 +240,13 @@ else if ($exist:resource eq "outline") then
else if ($exist:resource eq "debug") then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<!-- Query is executed by XQueryServlet -->
<forward url="modules/debuger.xql">
<forward url="modules/debuger.xq">
{$login("org.exist.login", (), false())}
<set-header name="Cache-Control" value="no-cache"/>
</forward>
</dispatch>

else if (ends-with($exist:path, ".xql")) then
else if (ends-with($exist:path, ".xq")) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
{$login("org.exist.login", (), false())}
<set-header name="Cache-Control" value="no-cache"/>
Expand Down
2 changes: 1 addition & 1 deletion expath-pkg.xml.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="http://exist-db.org/apps/eXide" abbrev="eXide" version="{{version}}" spec="1.0">
<title>eXide - XQuery IDE</title>
<dependency processor="http://exist-db.org" semver-min="5.2.0"/>
<dependency processor="http://exist-db.org" semver-min="5.3.0"/>
</package>
2 changes: 1 addition & 1 deletion index.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
<div class="eXide-browse-upload">
<p>Drop files here or click on the button below to upload them
to the selected collection. Maximum file size is 100MB.</p>
<form class="file_upload" action="modules/upload.xql" method="POST" enctype="multipart/form-data">
<form class="file_upload" action="modules/upload.xq" method="POST" enctype="multipart/form-data">
<div class="options">
<input type="checkbox" name="deploy" id="auto-deploy"/>
<label for="auto-deploy">Auto deploy uploaded .xar packages</label>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion modules/debuger.xql → modules/debuger.xq
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:)
xquery version "3.0";

import module namespace sandbox="http://exist-db.org/xquery/sandbox" at "session.xql";
import module namespace sandbox="http://exist-db.org/xquery/sandbox" at "session.xq";

declare namespace json="http://json.org/";
declare namespace dbg="urn:debugger_protocol_v1";
Expand Down
6 changes: 3 additions & 3 deletions modules/deployment.xql → modules/deployment.xq
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
:)
xquery version "3.1";

import module namespace apputil="http://exist-db.org/apps/eXide/apputil" at "util.xql";
import module namespace tmpl="http://exist-db.org/xquery/template" at "tmpl.xql";
import module namespace dbutil="http://exist-db.org/xquery/dbutil" at "dbutils.xql";
import module namespace apputil="http://exist-db.org/apps/eXide/apputil" at "util.xqm";
import module namespace tmpl="http://exist-db.org/xquery/template" at "tmpl.xqm";
import module namespace dbutil="http://exist-db.org/xquery/dbutil" at "dbutils.xqm";

(:~
Edit the expath and repo app descriptors.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion modules/git.xql → modules/git.xq
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
xquery version "3.0";

import module namespace process="http://exist-db.org/xquery/process" at "java:org.exist.xquery.modules.process.ProcessModule";
import module namespace apputil="http://exist-db.org/apps/eXide/apputil" at "util.xql";
import module namespace apputil="http://exist-db.org/apps/eXide/apputil" at "util.xqm";

declare namespace git="http://exist-db.org/eXide/git";

Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions modules/run-test.xql → modules/run-test.xq
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
xquery version "3.0";

import module namespace test="http://exist-db.org/xquery/xqsuite"
at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql";
import module namespace test="http://exist-db.org/xquery/xqsuite" at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xq";

declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";

Expand Down
2 changes: 1 addition & 1 deletion modules/search.xql → modules/search.xq
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
xquery version "3.1";


import module namespace dbutil="http://exist-db.org/xquery/dbutil" at "dbutils.xql";
import module namespace dbutil="http://exist-db.org/xquery/dbutil" at "dbutils.xqm";

declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization";

Expand Down
4 changes: 2 additions & 2 deletions modules/session.xql → modules/session.xq
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ declare function local:store-in-session($results as item()*) as element(result)
the results into the HTTP session for subsequent retrieval via individual
requests to this endpoint with a "num" parameter.
Error reporting must take into account how controller.xql handles
Error reporting must take into account how controller.xq handles
errors thrown by XQueryServlet. From https://exist-db.org/exist/apps/doc/urlrewrite#xq-servlet:
> Since controller.xql sets xquery.report-errors to "yes", an error
> Since controller.xq sets xquery.report-errors to "yes", an error
> in the XQuery will not result in an HTTP error. Instead, the string
> message of the error is enclosed in an element <error> which is
> then written to the response stream. The HTTP status is not changed.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion modules/synchronize.xql → modules/synchronize.xq
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
xquery version "1.0";

import module namespace file="http://exist-db.org/xquery/file" at "java:org.exist.xquery.modules.file.FileModule";
import module namespace apputil="http://exist-db.org/apps/eXide/apputil" at "util.xql";
import module namespace apputil="http://exist-db.org/apps/eXide/apputil" at "util.xqm";

declare function local:format-output($output) {
if ($output//file:update) then
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion repo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<copyright>true</copyright>
<type>application</type>
<target>eXide</target>
<prepare>pre-install.xql</prepare>
<prepare>pre-install.xq</prepare>
<finish/>
<permissions xmlns:repo="http://exist-db.org/xquery/repo" password="eXide" user="eXide" group="eXide" mode="0775"/>
<changelog>
Expand Down
2 changes: 1 addition & 1 deletion src/debuger.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ eXide.XQueryDebuger = (function () {
params.resource = this.existURL + this.doc.getPath();
$.ajax({
type: "POST",
url: "modules/debuger.xql",
url: "modules/debuger.xq",
data: params,
dataType: "json",
success: function (data) {
Expand Down
10 changes: 5 additions & 5 deletions src/deployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ eXide.edit.Projects = (function(oop) {

Constr.prototype.getProject = function (collection, callback) {
var $this = this;
$.getJSON("modules/deployment.xql", { info: collection }, function (data) {
$.getJSON("modules/deployment.xq", { info: collection }, function (data) {
if (!data) {
if (typeof callback == "function") {
callback(null);
Expand Down Expand Up @@ -144,7 +144,7 @@ eXide.edit.PackageEditor = (function () {

var params = $this.syncDialog.find("form").serialize();
$("#synchronize-report").text("Synchronization in progress ...");
$("#synchronize-report").load("modules/synchronize.xql", params);
$("#synchronize-report").load("modules/synchronize.xq", params);
},
"Close": function () { $(this).dialog("close"); }
}
Expand Down Expand Up @@ -195,7 +195,7 @@ eXide.edit.PackageEditor = (function () {

$(statusAnchor).text("Synchronization in progress ...");
$(statusAnchor).load(
"modules/synchronize.xql",
"modules/synchronize.xq",
{ collection : $this.currentProject.root, start :start},
function(responseText, status){if(status == 'success') {eXide.app.git.command($this.currentProject, 'commit', option);}}
);
Expand All @@ -215,7 +215,7 @@ eXide.edit.PackageEditor = (function () {
var indentOnDownloadPackage = $("#indent-on-download-package").is(":checked");
var expandXIncludesOnDownloadPackage = $("#expand-xincludes-on-download-package").is(":checked");
var omitXMLDeclatarionOnDownloadPackage = $("#omit-xml-decl-on-download-package").is(":checked");
window.location.href = "modules/deployment.xql?download=true&collection=" + encodeURIComponent(collection) + "&indent=" + indentOnDownloadPackage + "&expand-xincludes=" + expandXIncludesOnDownloadPackage + "&omit-xml-decl=" + omitXMLDeclatarionOnDownloadPackage;
window.location.href = "modules/deployment.xq?download=true&collection=" + encodeURIComponent(collection) + "&indent=" + indentOnDownloadPackage + "&expand-xincludes=" + expandXIncludesOnDownloadPackage + "&omit-xml-decl=" + omitXMLDeclatarionOnDownloadPackage;
};

/**
Expand Down Expand Up @@ -258,7 +258,7 @@ eXide.edit.PackageEditor = (function () {
dir: project.dir
};
$.ajax({
url: "modules/synchronize.xql",
url: "modules/synchronize.xq",
type: "GET",
data: params,
success: function(data) {
Expand Down
2 changes: 1 addition & 1 deletion src/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ eXide.edit.Directory = (function () {
}
return fn(d)
}
d3.json("modules/collections.xql?root=" + (sel.datum().key || "/db") + "&view=r", function(error, data){
d3.json("modules/collections.xq?root=" + (sel.datum().key || "/db") + "&view=r", function(error, data){
if(error) {
return
}
Expand Down
10 changes: 5 additions & 5 deletions src/eXide.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ eXide.app = (function(util) {
return true;
}
$.ajax({
url: "modules/load.xql",
url: "modules/load.xq",
dataType: 'text',
data: { "path": resource.path, "indent": indentOnOpen, "expand-xincludes": expandXIncludesOnOpen, "omit-xml-decl": omitXMLDeclatarionOnOpen },
success: function (data, status, xhr) {
Expand Down Expand Up @@ -458,7 +458,7 @@ eXide.app = (function(util) {
util.error("There are unsaved changes in the document. Please save it first.");
return;
}
window.location.href = "modules/load.xql?download=true&path=" + encodeURIComponent(doc.getPath()) + "&indent=" + indentOnDownload + "&expand-xincludes=" + expandXIncludesOnDownload + "&omit-xml-decl=" + omitXMLDeclatarionOnDownload;
window.location.href = "modules/load.xq?download=true&path=" + encodeURIComponent(doc.getPath()) + "&indent=" + indentOnDownload + "&expand-xincludes=" + expandXIncludesOnDownload + "&omit-xml-decl=" + omitXMLDeclatarionOnDownload;
},

runQuery: function(path, livePreview) {
Expand Down Expand Up @@ -995,7 +995,7 @@ eXide.app = (function(util) {
},

git: function() {
var gitUrl ='modules/git.xql',
var gitUrl ="modules/git.xq",
gitError = function(xhr, status) {
util.error("Failed to apply configuration: " + xhr.responseText);
},
Expand Down Expand Up @@ -1079,7 +1079,7 @@ eXide.app = (function(util) {
iframe.contentWindow.document.write("<html><body><p>Searching ...</p></body></html>");
iframe.contentWindow.document.close();

iframe.src = "modules/search.xql?" + searchParams;
iframe.src = "modules/search.xq?" + searchParams;
});
});
},
Expand Down Expand Up @@ -1247,7 +1247,7 @@ eXide.app = (function(util) {
dataType: "json",
open: function() {
$.ajax({
url: "modules/get-template.xql",
url: "modules/get-template.xq",
type: "POST",
success: function(data) {
templates = data;
Expand Down
2 changes: 1 addition & 1 deletion src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ eXide.edit.Editor = (function () {
}
var self = this;
$.ajax({
url: "modules/get-template.xql",
url: "modules/get-template.xq",
type: "POST",
data: { template: template },
dataType: "text",
Expand Down
16 changes: 8 additions & 8 deletions src/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DataSource {
if (options.filterModel.name) {
params.filter = options.filterModel.name.filter;
}
$.getJSON("modules/collections.xql", params, (json) => {
$.getJSON("modules/collections.xq", params, (json) => {
if (json && json.items) {
options.successCallback(json.items, json.total);
if (this.data.length === 0) {
Expand Down Expand Up @@ -309,7 +309,7 @@ eXide.browse.ResourceBrowser = (function () {
return;
}
params.column.colDef.editable = false;
$.getJSON('modules/collections.xql', {
$.getJSON("modules/collections.xq", {
target: params.data.name,
rename: this.oldValue,
root: this.dataSource.collection
Expand Down Expand Up @@ -344,7 +344,7 @@ eXide.browse.ResourceBrowser = (function () {
}
var params = $("form", dialog).serialize();
params = params + "&" + $.param({ "modify[]": resources});
$.getJSON("modules/collections.xql", params,
$.getJSON("modules/collections.xq", params,
function(data) {
$(dialog).dialog("close");
$this.reload();
Expand Down Expand Up @@ -450,7 +450,7 @@ eXide.browse.ResourceBrowser = (function () {
"<input type=\"text\" name=\"collection\" id=\"eXide-browse-collection-name\"/>",
function () {
$("#eXide-browse-spinner").show();
$.getJSON("modules/collections.xql", {
$.getJSON("modules/collections.xq", {
create: $("#eXide-browse-collection-name").val(),
collection: $this.dataSource.collection
},
Expand All @@ -472,7 +472,7 @@ eXide.browse.ResourceBrowser = (function () {
eXide.util.Dialog.input("Confirm Deletion", "Are you sure you want to delete collection " + $this.selected + "?",
function () {
$("#eXide-browse-spinner").show();
$.getJSON("modules/collections.xql", {
$.getJSON("modules/collections.xq", {
remove: $this.dataSource.collection
},
function (data) {
Expand Down Expand Up @@ -501,7 +501,7 @@ eXide.browse.ResourceBrowser = (function () {
eXide.util.Dialog.input("Confirm Deletion", "Are you sure you want to delete the selected resources?",
function () {
$("#eXide-browse-spinner").show();
$.getJSON("modules/collections.xql", {
$.getJSON("modules/collections.xq", {
remove: resources,
root: $this.dataSource.collection
},
Expand All @@ -528,7 +528,7 @@ eXide.browse.ResourceBrowser = (function () {
}
}
if (resources.length > 0) {
$("#resource-properties-content").load("modules/collections.xql", { "properties": resources });
$("#resource-properties-content").load("modules/collections.xq", { "properties": resources });
$("#resource-properties-dialog").dialog("open");
}
};
Expand Down Expand Up @@ -563,7 +563,7 @@ eXide.browse.ResourceBrowser = (function () {
$.log("Pasting resources %o to %s in mode %s", this.clipboard, this.dataSource.collection, this.clipboardMode);
var params = { root: this.dataSource.collection };
params[this.clipboardMode] = this.clipboard;
$.getJSON("modules/collections.xql", params,
$.getJSON("modules/collections.xq", params,
function (data) {
$.log(data.status);
if (data.status == "fail") {
Expand Down
6 changes: 3 additions & 3 deletions src/xml-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ eXide.edit.XMLModeHelper = (function () {
var $this = this;
$.ajax({
type: "PUT",
url: "modules/validate-xml.xql",
url: "modules/validate-xml.xq",
data: code,
contentType: "application/octet-stream",
dataType: "json",
Expand Down Expand Up @@ -138,7 +138,7 @@ eXide.edit.XMLModeHelper = (function () {
$.log("Getting suggestions for %s", text);
$.ajax({
type: "POST",
url: "modules/validate-xml.xql",
url: "modules/validate-xml.xq",
data: {
xml: text,
row: row,
Expand All @@ -164,7 +164,7 @@ eXide.edit.XMLModeHelper = (function () {
eXide.util.message("Apply configuration and reindex...");
$.ajax({
type: "POST",
url: "modules/apply-config.xql",
url: "modules/apply-config.xq",
data: {
collection: doc.getBasePath(),
config: doc.getName()
Expand Down
Loading

0 comments on commit 0aa5488

Please sign in to comment.