From 63fd904c6e94c0580ff560dcd2223ccade3ea861 Mon Sep 17 00:00:00 2001 From: Joe Wicentowski Date: Sun, 24 Mar 2019 00:13:14 -0400 Subject: [PATCH 01/43] Add readme.md --- .gitignore | 5 - README.md | 1 + Readme.md | 25 - build.xml | 45 - collection.xconf | 6 - configuration.xml | 5 - controller.xql | 99 -- dashboard-webdriver/pom.xml | 69 - .../java/org/exist/WebDriverFirefox5Test.java | 102 -- .../test/java/org/exist/WebDriverIE8Test.java | 103 -- defaults.xml | 82 -- error-page.html | 9 - expath-pkg.xml.tmpl | 7 - icon.png | Bin 6866 -> 0 bytes index.html | 35 - modules/app.xql | 17 - modules/config.xqm | 102 -- modules/dashboard.xql | 29 - modules/get-icon.xql | 11 - modules/get-packages.xql | 24 - modules/install.xql | 141 --- modules/login-helper.xql | 55 - modules/restxq.xql | 419 ------- modules/templates.xql | 504 -------- modules/view.xql | 38 - plugins/backup/backup.css | 19 - plugins/backup/backup.html | 29 - plugins/backup/backup.js | 123 -- plugins/backup/backup.less | 29 - plugins/backup/backup.xql | 71 -- plugins/backup/images/application_get.png | Bin 581 -> 0 bytes plugins/backup/images/arrow_refresh.png | Bin 685 -> 0 bytes plugins/backup/images/download-32.png | Bin 1352 -> 0 bytes plugins/backup/images/icon.png | Bin 2419 -> 0 bytes plugins/base.js | 86 -- plugins/browsing/browsing.css | 135 -- plugins/browsing/browsing.html | 136 -- plugins/browsing/browsing.js | 664 ---------- plugins/browsing/browsing.less | 155 --- plugins/browsing/controller.xql | 54 - .../browsing/images/application_form_edit.png | Bin 714 -> 0 bytes plugins/browsing/images/arrow_refresh.png | Bin 685 -> 0 bytes plugins/browsing/images/bin.png | Bin 476 -> 0 bytes plugins/browsing/images/cut.png | Bin 648 -> 0 bytes plugins/browsing/images/database_add.png | Bin 658 -> 0 bytes plugins/browsing/images/database_refresh.png | Bin 770 -> 0 bytes plugins/browsing/images/folder_add.png | Bin 668 -> 0 bytes plugins/browsing/images/icon.png | Bin 9171 -> 0 bytes plugins/browsing/images/page_copy.png | Bin 663 -> 0 bytes plugins/browsing/images/page_paste.png | Bin 703 -> 0 bytes plugins/browsing/images/progressbar.gif | Bin 3323 -> 0 bytes plugins/browsing/service.xql | 534 -------- plugins/browsing/upload.xql | 29 - plugins/images/backup.png | Bin 59828 -> 0 bytes plugins/images/shutdown.png | Bin 2324 -> 0 bytes plugins/packageManager/controller.xql | 64 - plugins/packageManager/images/Remove-32.png | Bin 2222 -> 0 bytes plugins/packageManager/images/Upload-24.png | Bin 1436 -> 0 bytes plugins/packageManager/images/Upload-32.png | Bin 2091 -> 0 bytes plugins/packageManager/images/dbplus2.png | Bin 5932 -> 0 bytes plugins/packageManager/images/deleteApp.png | Bin 5876 -> 0 bytes plugins/packageManager/images/deleteApp1.png | Bin 3514 -> 0 bytes plugins/packageManager/images/download-32.png | Bin 1352 -> 0 bytes .../packageManager/images/packages-128.png | Bin 8763 -> 0 bytes plugins/packageManager/images/progressbar.gif | Bin 3323 -> 0 bytes plugins/packageManager/packageManager.css | 299 ----- plugins/packageManager/packageManager.html | 46 - plugins/packageManager/packageManager.js | 296 ----- plugins/packageManager/packageManager.less | 353 ------ plugins/packageManager/packages.xql | 408 ------ plugins/profiling/profiling.html | 25 - plugins/profiling/profiling.js | 46 - plugins/profiling/profiling.less | 21 - plugins/scheduler/controller.xql | 54 - plugins/scheduler/scheduler.css | 132 -- plugins/scheduler/scheduler.html | 4 - plugins/scheduler/scheduler.js | 234 ---- plugins/scheduler/service.xql | 146 --- plugins/shutdown/icon.png | Bin 6475 -> 0 bytes plugins/shutdown/shutdown.html | 10 - plugins/shutdown/shutdown.js | 35 - plugins/shutdown/shutdown.xql | 5 - plugins/uploader.js | 85 -- plugins/userManager/controller.xql | 267 ---- plugins/userManager/icon.png | Bin 4681 -> 0 bytes plugins/userManager/jsjson.xqm | 317 ----- plugins/userManager/userManager.css | 63 - plugins/userManager/userManager.html | 240 ---- plugins/userManager/userManager.js | 1058 ---------------- plugins/userManager/userManager.less | 91 -- plugins/userManager/userManager.xqm | 282 ----- plugins/util.js | 115 -- pre-install.xql | 32 - repo.xml | 93 -- resources/css/Quicksand_Book-webfont.eot | Bin 26680 -> 0 bytes resources/css/Quicksand_Book-webfont.svg | 149 --- resources/css/Quicksand_Book-webfont.ttf | Bin 26512 -> 0 bytes resources/css/Quicksand_Book-webfont.woff | Bin 17356 -> 0 bytes resources/css/base.css | 0 resources/css/base.less | 41 - resources/css/fonts.css | 12 - resources/css/global.css | 363 ------ resources/css/global.less | 374 ------ resources/images/1332878545_user_group.png | Bin 4714 -> 0 bytes resources/images/Java-icon.png | Bin 16004 -> 0 bytes resources/images/app.gif | Bin 3431 -> 0 bytes resources/images/close.png | Bin 1314 -> 0 bytes resources/images/close_exit.png | Bin 3394 -> 0 bytes resources/images/config-gear.png | Bin 1008 -> 0 bytes resources/images/configuration.png | Bin 30746 -> 0 bytes resources/images/dashboard.png | Bin 18139 -> 0 bytes resources/images/delete.png | Bin 150 -> 0 bytes resources/images/existdb.gif | Bin 5887 -> 0 bytes resources/images/existdb.png | Bin 8280 -> 0 bytes resources/images/favicon.ico | Bin 1150 -> 0 bytes resources/images/folder.png | Bin 30167 -> 0 bytes resources/images/help.png | Bin 35195 -> 0 bytes resources/images/install.png | Bin 4198 -> 0 bytes resources/images/library.gif | Bin 1042 -> 0 bytes resources/images/library2-mark.gif | Bin 2893 -> 0 bytes resources/images/library2.gif | Bin 3235 -> 0 bytes resources/images/package.png | Bin 69076 -> 0 bytes resources/images/plugin.gif | Bin 1027 -> 0 bytes resources/images/plugin2-mark.gif | Bin 2893 -> 0 bytes resources/images/plugin2.gif | Bin 3228 -> 0 bytes resources/images/plus.gif | Bin 88 -> 0 bytes resources/images/pluss.png | Bin 1299 -> 0 bytes resources/images/plusss.png | Bin 1424 -> 0 bytes resources/images/release-notes.png | Bin 1299 -> 0 bytes resources/images/remove.png | Bin 2931 -> 0 bytes resources/images/statistic.png | Bin 27544 -> 0 bytes resources/images/tooltipConnectorDown.gif | Bin 205 -> 0 bytes resources/images/uninstall.png | Bin 4096 -> 0 bytes resources/images/upload-arrow.png | Bin 948 -> 0 bytes resources/images/upload.png | Bin 1887 -> 0 bytes resources/images/user-admin.png | Bin 24395 -> 0 bytes resources/scripts/dashboard-1.7.js | 490 -------- resources/scripts/jquery.fileupload.js | 1113 ----------------- resources/scripts/jquery.ui.widget.js | 528 -------- templates/page.html | 60 - 140 files changed, 1 insertion(+), 11947 deletions(-) delete mode 100644 .gitignore create mode 100644 README.md delete mode 100644 Readme.md delete mode 100644 build.xml delete mode 100644 collection.xconf delete mode 100644 configuration.xml delete mode 100644 controller.xql delete mode 100644 dashboard-webdriver/pom.xml delete mode 100644 dashboard-webdriver/src/test/java/org/exist/WebDriverFirefox5Test.java delete mode 100644 dashboard-webdriver/src/test/java/org/exist/WebDriverIE8Test.java delete mode 100644 defaults.xml delete mode 100644 error-page.html delete mode 100644 expath-pkg.xml.tmpl delete mode 100644 icon.png delete mode 100644 index.html delete mode 100644 modules/app.xql delete mode 100644 modules/config.xqm delete mode 100644 modules/dashboard.xql delete mode 100644 modules/get-icon.xql delete mode 100644 modules/get-packages.xql delete mode 100644 modules/install.xql delete mode 100644 modules/login-helper.xql delete mode 100644 modules/restxq.xql delete mode 100644 modules/templates.xql delete mode 100644 modules/view.xql delete mode 100644 plugins/backup/backup.css delete mode 100644 plugins/backup/backup.html delete mode 100644 plugins/backup/backup.js delete mode 100644 plugins/backup/backup.less delete mode 100644 plugins/backup/backup.xql delete mode 100644 plugins/backup/images/application_get.png delete mode 100644 plugins/backup/images/arrow_refresh.png delete mode 100644 plugins/backup/images/download-32.png delete mode 100644 plugins/backup/images/icon.png delete mode 100644 plugins/base.js delete mode 100644 plugins/browsing/browsing.css delete mode 100644 plugins/browsing/browsing.html delete mode 100644 plugins/browsing/browsing.js delete mode 100644 plugins/browsing/browsing.less delete mode 100644 plugins/browsing/controller.xql delete mode 100644 plugins/browsing/images/application_form_edit.png delete mode 100644 plugins/browsing/images/arrow_refresh.png delete mode 100644 plugins/browsing/images/bin.png delete mode 100644 plugins/browsing/images/cut.png delete mode 100644 plugins/browsing/images/database_add.png delete mode 100644 plugins/browsing/images/database_refresh.png delete mode 100644 plugins/browsing/images/folder_add.png delete mode 100644 plugins/browsing/images/icon.png delete mode 100644 plugins/browsing/images/page_copy.png delete mode 100644 plugins/browsing/images/page_paste.png delete mode 100644 plugins/browsing/images/progressbar.gif delete mode 100644 plugins/browsing/service.xql delete mode 100644 plugins/browsing/upload.xql delete mode 100644 plugins/images/backup.png delete mode 100644 plugins/images/shutdown.png delete mode 100644 plugins/packageManager/controller.xql delete mode 100644 plugins/packageManager/images/Remove-32.png delete mode 100644 plugins/packageManager/images/Upload-24.png delete mode 100644 plugins/packageManager/images/Upload-32.png delete mode 100644 plugins/packageManager/images/dbplus2.png delete mode 100644 plugins/packageManager/images/deleteApp.png delete mode 100644 plugins/packageManager/images/deleteApp1.png delete mode 100644 plugins/packageManager/images/download-32.png delete mode 100644 plugins/packageManager/images/packages-128.png delete mode 100644 plugins/packageManager/images/progressbar.gif delete mode 100644 plugins/packageManager/packageManager.css delete mode 100644 plugins/packageManager/packageManager.html delete mode 100644 plugins/packageManager/packageManager.js delete mode 100644 plugins/packageManager/packageManager.less delete mode 100644 plugins/packageManager/packages.xql delete mode 100644 plugins/profiling/profiling.html delete mode 100644 plugins/profiling/profiling.js delete mode 100644 plugins/profiling/profiling.less delete mode 100644 plugins/scheduler/controller.xql delete mode 100644 plugins/scheduler/scheduler.css delete mode 100644 plugins/scheduler/scheduler.html delete mode 100644 plugins/scheduler/scheduler.js delete mode 100644 plugins/scheduler/service.xql delete mode 100644 plugins/shutdown/icon.png delete mode 100644 plugins/shutdown/shutdown.html delete mode 100644 plugins/shutdown/shutdown.js delete mode 100644 plugins/shutdown/shutdown.xql delete mode 100644 plugins/uploader.js delete mode 100644 plugins/userManager/controller.xql delete mode 100644 plugins/userManager/icon.png delete mode 100644 plugins/userManager/jsjson.xqm delete mode 100644 plugins/userManager/userManager.css delete mode 100644 plugins/userManager/userManager.html delete mode 100644 plugins/userManager/userManager.js delete mode 100644 plugins/userManager/userManager.less delete mode 100644 plugins/userManager/userManager.xqm delete mode 100644 plugins/util.js delete mode 100644 pre-install.xql delete mode 100644 repo.xml delete mode 100644 resources/css/Quicksand_Book-webfont.eot delete mode 100644 resources/css/Quicksand_Book-webfont.svg delete mode 100644 resources/css/Quicksand_Book-webfont.ttf delete mode 100644 resources/css/Quicksand_Book-webfont.woff delete mode 100644 resources/css/base.css delete mode 100644 resources/css/base.less delete mode 100644 resources/css/fonts.css delete mode 100644 resources/css/global.css delete mode 100644 resources/css/global.less delete mode 100644 resources/images/1332878545_user_group.png delete mode 100644 resources/images/Java-icon.png delete mode 100644 resources/images/app.gif delete mode 100644 resources/images/close.png delete mode 100644 resources/images/close_exit.png delete mode 100644 resources/images/config-gear.png delete mode 100644 resources/images/configuration.png delete mode 100644 resources/images/dashboard.png delete mode 100644 resources/images/delete.png delete mode 100644 resources/images/existdb.gif delete mode 100644 resources/images/existdb.png delete mode 100644 resources/images/favicon.ico delete mode 100644 resources/images/folder.png delete mode 100644 resources/images/help.png delete mode 100644 resources/images/install.png delete mode 100644 resources/images/library.gif delete mode 100644 resources/images/library2-mark.gif delete mode 100644 resources/images/library2.gif delete mode 100644 resources/images/package.png delete mode 100644 resources/images/plugin.gif delete mode 100644 resources/images/plugin2-mark.gif delete mode 100644 resources/images/plugin2.gif delete mode 100644 resources/images/plus.gif delete mode 100644 resources/images/pluss.png delete mode 100644 resources/images/plusss.png delete mode 100644 resources/images/release-notes.png delete mode 100644 resources/images/remove.png delete mode 100644 resources/images/statistic.png delete mode 100644 resources/images/tooltipConnectorDown.gif delete mode 100644 resources/images/uninstall.png delete mode 100644 resources/images/upload-arrow.png delete mode 100644 resources/images/upload.png delete mode 100644 resources/images/user-admin.png delete mode 100644 resources/scripts/dashboard-1.7.js delete mode 100755 resources/scripts/jquery.fileupload.js delete mode 100644 resources/scripts/jquery.ui.widget.js delete mode 100644 templates/page.html diff --git a/.gitignore b/.gitignore deleted file mode 100644 index dec191b9..00000000 --- a/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# .gitignore -*.xar -target/ -dashboard.iml -expath-pkg.xml diff --git a/README.md b/README.md new file mode 100644 index 00000000..ea786ff2 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +readme \ No newline at end of file diff --git a/Readme.md b/Readme.md deleted file mode 100644 index 14ccfa0d..00000000 --- a/Readme.md +++ /dev/null @@ -1,25 +0,0 @@ -IMPORTAN NOTE: Dashboard is deprecated and will be replaced by a new version independent of Dojo. The repository of the new version will be available here soon. - -![Dashboard logo](/eXist-db/dashboard/raw/master/icon.png) - -eXist-db Dashboard -================== - -The eXist-db Dashboard is the central application launchpad and administration facility for eXist-db. - -This repository contains the source code of the dashboard application. - -Building --------- - -The dashboard is distributed as a single .xar file, which can be installed into an eXist-db instance via the package manager. To build the .xar, you need to have Apache Ant installed. Alternatively you can use the Ant version which comes with eXist-db (call build.sh/build.bat from the eXist-db directory). - -Clone the dashboard repository to a local directory: - - git clone git://github.com/eXist-db/dashboard.git dashboard - -Change into the created directory and call - - ant - -This should create a .xar file in the build directory. diff --git a/build.xml b/build.xml deleted file mode 100644 index 38714d30..00000000 --- a/build.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/collection.xconf b/collection.xconf deleted file mode 100644 index c521ce37..00000000 --- a/collection.xconf +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/configuration.xml b/configuration.xml deleted file mode 100644 index e2ed7564..00000000 --- a/configuration.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - http://demo.exist-db.org/exist/apps/public-repo - - \ No newline at end of file diff --git a/controller.xql b/controller.xql deleted file mode 100644 index 12f13acc..00000000 --- a/controller.xql +++ /dev/null @@ -1,99 +0,0 @@ -xquery version "3.0"; - -declare namespace json="http://www.json.org"; -declare namespace control="http://exist-db.org/apps/dashboard/controller"; -declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; -declare namespace rest="http://exquery.org/ns/restxq"; - -import module namespace restxq="http://exist-db.org/xquery/restxq" at "modules/restxq.xql"; -import module namespace login-helper="http://exist-db.org/apps/dashboard/login-helper" at "modules/login-helper.xql"; -import module namespace login="http://exist-db.org/xquery/login" at "resource:org/exist/xquery/modules/persistentlogin/login.xql"; - -declare variable $exist:path external; -declare variable $exist:resource external; -declare variable $exist:controller external; -declare variable $exist:prefix external; -declare variable $exist:root external; - -declare variable $login := login-helper:get-login-method(); - -request:set-attribute("betterform.filter.ignoreResponseBody", "true"), -if ($exist:path eq '') then - - - - -else if ($exist:path = "/") then - (: forward root path to index.xql :) - - { - if (request:get-uri() eq "/exist/apps/dashboard/" and - request:get-header("X-Forwarded-URI") eq "/apps/dashboard/") - then - - else - - } - - -else if ($exist:resource = "get-icon.xql") then - - - - -else if (matches($exist:path, ".xql/?$")) then - - { $login("org.exist.login", (), true()) } - - - -else if ($exist:resource = "login") then ( - util:declare-option("exist:serialize", "method=json media-type=application/json"), - try { - let $loggedIn := $login("org.exist.login", (), true()) - let $user := request:get-attribute("org.exist.login.user") - return - if ($user and sm:is-dba($user)) then - - {$user} - true - - else ( - - Wrong user or password - - ) - } catch * { - - {$err:description} - - } - -) else if (ends-with($exist:resource, ".html")) then - (:~ - : Pages ending with .html are run through view.xql to - : expand templates. - :) - - - - {$login("org.exist.login", (), true())} - - - - - - - - - - -else if (starts-with($exist:path, "/_shared/")) then - - - - -else - - - diff --git a/dashboard-webdriver/pom.xml b/dashboard-webdriver/pom.xml deleted file mode 100644 index dc3990d5..00000000 --- a/dashboard-webdriver/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 4.0.0 - dashboard-webdriver - org.exist-db - 1.0-SNAPSHOT - jar - sauce_quickstart - A Sauce OnDemand project with WebDriver tests that run using JUnit - - - - - junit - junit - 4.10 - test - - - com.saucelabs - sauce_junit - [1.0.0,) - test - - - org.seleniumhq.selenium - selenium-java - LATEST - test - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.0.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.4.3 - - true - - - - - - - - saucelabs-repository - https://repository-saucelabs.forge.cloudbees.com/release - - true - - - true - - - - - diff --git a/dashboard-webdriver/src/test/java/org/exist/WebDriverFirefox5Test.java b/dashboard-webdriver/src/test/java/org/exist/WebDriverFirefox5Test.java deleted file mode 100644 index b105aa67..00000000 --- a/dashboard-webdriver/src/test/java/org/exist/WebDriverFirefox5Test.java +++ /dev/null @@ -1,102 +0,0 @@ -import com.saucelabs.common.SauceOnDemandAuthentication; -import com.saucelabs.common.SauceOnDemandSessionIdProvider; -import com.saucelabs.junit.SauceOnDemandTestWatcher; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestName; -import org.openqa.selenium.By; -import org.openqa.selenium.Platform; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.DesiredCapabilities; -import org.openqa.selenium.remote.RemoteWebDriver; -import org.openqa.selenium.remote.SessionId; - -import java.net.URL; -import java.util.List; - -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; - -/** - * {@link RemoteWebDriver} test running Selenium tests with Sauce OnDemand. - * - * This test also includes the Sauce JUnit helper classes, which will use the Sauce REST API to mark the Sauce Job as passed/failed. - * - * In order to use the {@link SauceOnDemandTestWatcher}, the test must implement the {@link SauceOnDemandSessionIdProvider} interface. - * - * @author Ross Rowe - * @author ljo - - */ -public class WebDriverFirefox5Test implements SauceOnDemandSessionIdProvider { - - /** - * Constructs a {@link SauceOnDemandAuthentication} instance using the supplied user name/access key. To use the authentication - * supplied by environment variables or from an external file, use the no-arg {@link SauceOnDemandAuthentication} constructor. - */ - public SauceOnDemandAuthentication authentication = new SauceOnDemandAuthentication(); - - /** - * JUnit Rule which will mark the Sauce Job as passed/failed when the test succeeds or fails. - */ - public @Rule - SauceOnDemandTestWatcher resultReportingTestWatcher = new SauceOnDemandTestWatcher(this, authentication); - - /** - * JUnit Rule which will record the test name of the current test. This is referenced when creating the {@link DesiredCapabilities}, - * so that the Sauce Job is created with the test name. - */ - public @Rule TestName testName= new TestName(); - - private WebDriver driver; - - private String sessionId; - - @Before - public void setUp() throws Exception { - - DesiredCapabilities capabillities = DesiredCapabilities.firefox(); - capabillities.setCapability("version", "5"); - capabillities.setCapability("platform", Platform.XP); - capabillities.setCapability("name", testName.getMethodName()); - this.driver = new RemoteWebDriver( - new URL("http://" + authentication.getUsername() + ":" + authentication.getAccessKey() + "@ondemand.saucelabs.com:80/wd/hub"), - capabillities); - this.sessionId = ((RemoteWebDriver)driver).getSessionId().toString(); - } - - @Override - public String getSessionId() { - return sessionId; - } - - @Test - public void dashboardTitleFirefox5() throws Exception { - driver.get("http://demo.exist-db.org/exist/apps/dashboard/"); - assertEquals("Dashboard", driver.getTitle()); - } - - @Test - public void dashboardFindAdminWebApplicationFirefox5() throws Exception { - //driver.findElement(By.id("eab07ced-6a67-4f4c-90ae-62946a76386e")).click(); - driver.get("http://demo.exist-db.org/exist/apps/dashboard/"); - List allButtons = driver.findElements(By.xpath("//button")); - boolean awaFound = false; - for (WebElement button : allButtons) { - if (button.getAttribute("title").equals("Admin Web Application")) { - awaFound = true; - break; - } - } - assertTrue(awaFound); - } - - @After - public void tearDown() throws Exception { - driver.quit(); - } - -} diff --git a/dashboard-webdriver/src/test/java/org/exist/WebDriverIE8Test.java b/dashboard-webdriver/src/test/java/org/exist/WebDriverIE8Test.java deleted file mode 100644 index 23b8c3bc..00000000 --- a/dashboard-webdriver/src/test/java/org/exist/WebDriverIE8Test.java +++ /dev/null @@ -1,103 +0,0 @@ -import com.saucelabs.common.SauceOnDemandAuthentication; -import com.saucelabs.common.SauceOnDemandSessionIdProvider; -import com.saucelabs.junit.SauceOnDemandTestWatcher; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestName; -import org.openqa.selenium.By; -import org.openqa.selenium.Platform; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.DesiredCapabilities; -import org.openqa.selenium.remote.RemoteWebDriver; -import org.openqa.selenium.remote.SessionId; - -import java.net.URL; -import java.util.List; - -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; - -/** - * {@link RemoteWebDriver} test running Selenium tests with Sauce OnDemand. - * - * This test also includes the Sauce JUnit helper classes, which will use the Sauce REST API to mark the Sauce Job as passed/failed. - * - * In order to use the {@link SauceOnDemandTestWatcher}, the test must implement the {@link SauceOnDemandSessionIdProvider} interface. - * - * @author Ross Rowe - * @author ljo - - */ -public class WebDriverIE8Test implements SauceOnDemandSessionIdProvider { - - /** - * Constructs a {@link SauceOnDemandAuthentication} instance using the supplied user name/access key. To use the authentication - * supplied by environment variables or from an external file, use the no-arg {@link SauceOnDemandAuthentication} constructor. - */ - public SauceOnDemandAuthentication authentication = new SauceOnDemandAuthentication(); - - /** - * JUnit Rule which will mark the Sauce Job as passed/failed when the test succeeds or fails. - */ - public @Rule - SauceOnDemandTestWatcher resultReportingTestWatcher = new SauceOnDemandTestWatcher(this, authentication); - - /** - * JUnit Rule which will record the test name of the current test. This is referenced when creating the {@link DesiredCapabilities}, - * so that the Sauce Job is created with the test name. - */ - public @Rule TestName testName= new TestName(); - - private WebDriver driver; - - private String sessionId; - - @Before - public void setUp() throws Exception { - - DesiredCapabilities capabillities = DesiredCapabilities.internetExplorer(); - capabillities.setCapability("version", "8"); - capabillities.setCapability("platform", Platform.XP); - capabillities.setCapability("name", testName.getMethodName()); - this.driver = new RemoteWebDriver( - new URL("http://" + authentication.getUsername() + ":" + authentication.getAccessKey() + "@ondemand.saucelabs.com:80/wd/hub"), - capabillities); - this.sessionId = ((RemoteWebDriver)driver).getSessionId().toString(); - } - - @Override - public String getSessionId() { - return sessionId; - } - - @Test - public void dashboardTitleIE8() throws Exception { - //get http://localhost:8080/exist/apps/dashboard/index.html - driver.get("http://demo.exist-db.org/exist/apps/dashboard/"); - assertEquals("Dashboard", driver.getTitle()); - } - - @Test - public void dashboardFindAdminWebApplicationIE8() throws Exception { - //driver.findElement(By.id("eab07ced-6a67-4f4c-90ae-62946a76386e")); - driver.get("http://demo.exist-db.org/exist/apps/dashboard/"); - List allButtons = driver.findElements(By.xpath("//button")); - boolean awaFound = false; - for (WebElement button : allButtons) { - if (button.getAttribute("title").equals("Admin Web Application")) { - awaFound = true; - break; - } - } - assertTrue(awaFound); - } - - @After - public void tearDown() throws Exception { - driver.quit(); - } - -} diff --git a/defaults.xml b/defaults.xml deleted file mode 100644 index 7a6bb675..00000000 --- a/defaults.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - Java Admin Client - webstart - 1.0 - resources/images/Java-icon.png - ../../webstart/exist.jnlp - application - - - Collections - browsing - 1.0 - plugins/browsing/images/icon.png - plugin:browsing - plugin - - - Shutdown - shutdown - 1.0 - plugins/shutdown/icon.png - plugin:shutdown - plugin - - - Backup - backup - 1.0 - plugins/backup/images/icon.png - plugin:backup - plugin - - - Package Manager - packageManager - 1.0 - plugins/packageManager/images/packages-128.png - plugin:packageManager - plugin - - - - - diff --git a/error-page.html b/error-page.html deleted file mode 100644 index 44ed0d77..00000000 --- a/error-page.html +++ /dev/null @@ -1,9 +0,0 @@ - -
-

An error has occurred

-

An error has been generated by the application.

-
-    
-
\ No newline at end of file diff --git a/expath-pkg.xml.tmpl b/expath-pkg.xml.tmpl deleted file mode 100644 index a00f647c..00000000 --- a/expath-pkg.xml.tmpl +++ /dev/null @@ -1,7 +0,0 @@ - - - Dashboard - - - - diff --git a/icon.png b/icon.png deleted file mode 100644 index d860035bfbc42e27db5c862372a8922a7d787253..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6866 zcma)BWmg+a6AeL&7bx!TT3ian-QBggyIXN6?(Qyu0>Qlnf?Fxp7I!B&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6C1OqDrMwT`LIg$152za#N!M*}}D@km~Ff^tQJ> zB=WbF+^DGT_KyV=>Kc*^vmNV&I{bJYg)f?$&L~l_x1<&4Y${~F9gd*vbNm+LTryoL{`pY9A2KPO>LFCrO+4iqfm+7koB zRsS#q289+CZ>L4B+u(fBTAngETcp~uuTW%S$ibw|J z&G7!XKDj%QCrJ*R4%iR8@W{WcJ3{olR&W_6qJJBP9<>2%fUTijTMbtpJc96nsH{lt zM-wNta9Y&Bh|s^{)U$}y{gS88ouA()Bb5X5039aut}B3(2}?2>En-Q-dZhOV2txNp zMI_s=dCg{Iof$??{d@aL^{A?&k0Sx~BX7vl{DtiN@GKzM{}Vu7T1Beyvsw860OS-; AMgRZ+ diff --git a/index.html b/index.html deleted file mode 100644 index 5c0bce88..00000000 --- a/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -
- -
-
- -
-
-
-
-
    -
  • -
    - -
    -
    -
    - - -
    -
    -
    -
  • -
-
-
\ No newline at end of file diff --git a/modules/app.xql b/modules/app.xql deleted file mode 100644 index 6b24d202..00000000 --- a/modules/app.xql +++ /dev/null @@ -1,17 +0,0 @@ -module namespace app="http://exist-db.org/xquery/app"; - -import module namespace templates="http://exist-db.org/xquery/templates" at "templates.xql"; - -(:~ - : This is a sample templating function. It will be called by the templating module if - : it encounters an HTML element with a class attribute: class="app:test". The function - : has to take exactly 3 parameters. - : - : @param $node the HTML node with the class attribute which triggered this call - : @param $params an XML fragment containing any parameters passed with the class - : @param $model an arbitrary sequence - used to pass information between template calls - :) -declare function app:test($node as node(), $params as element(parameters)?, $model as item()*) { -

Dummy paragraph. It was generated by function - app:test at {current-dateTime()}.

-}; \ No newline at end of file diff --git a/modules/config.xqm b/modules/config.xqm deleted file mode 100644 index 2f28d127..00000000 --- a/modules/config.xqm +++ /dev/null @@ -1,102 +0,0 @@ -xquery version "3.0"; - -(:~ - : A set of helper functions to access the application context from - : within a module. - :) -module namespace config="http://exist-db.org/xquery/apps/config"; - -import module namespace templates="http://exist-db.org/xquery/templates" at "templates.xql"; - -declare namespace repo="http://exist-db.org/xquery/repo"; -declare namespace expath="http://expath.org/ns/pkg"; - -(: - Determine the application root collection from the current module load path. -:) -declare variable $config:app-root := - let $rawPath := system:get-module-load-path() - let $modulePath := - (: strip the xmldb: part :) - if (starts-with($rawPath, "xmldb:exist://")) then - if (starts-with($rawPath, "xmldb:exist://embedded-eXist-server")) then - substring($rawPath, 36) - else - substring($rawPath, 15) - else - $rawPath - return - substring-before($modulePath, "/modules") -; - -declare variable $config:repo-descriptor := doc(concat($config:app-root, "/repo.xml"))/repo:meta; - -declare variable $config:expath-descriptor := doc(concat($config:app-root, "/expath-pkg.xml"))/expath:package; - -declare variable $config:SETTINGS := doc($config:app-root || "/configuration.xml")/settings; - -declare variable $config:REPO := xs:anyURI($config:SETTINGS/repository); - -(:~ - : Resolve the given path using the current application context. - : If the app resides in the file system, - :) -declare function config:resolve($relPath as xs:string) { - if (starts-with($config:app-root, "/db")) then - doc(concat($config:app-root, "/", $relPath)) - else - doc(concat("file://", $config:app-root, "/", $relPath)) -}; - -(:~ - : Returns the repo.xml descriptor for the current application. - :) -declare function config:repo-descriptor() as element(repo:meta) { - $config:repo-descriptor -}; - -(:~ - : Returns the expath-pkg.xml descriptor for the current application. - :) -declare function config:expath-descriptor() as element(expath:package) { - $config:expath-descriptor -}; - -declare %templates:wrap function config:app-title($node as node(), $model as map(*)) as text() { - $config:expath-descriptor/expath:title/text() -}; - -declare function config:app-meta($node as node(), $model as map(*)) as element()* { - , - for $author in $config:repo-descriptor/repo:author - return - -}; - -(:~ - : For debugging: generates a table showing all properties defined - : in the application descriptors. - :) -declare function config:app-info($node as node(), $model as map(*)) { - let $expath := config:expath-descriptor() - let $repo := config:repo-descriptor() - return - - - - - - { - for $attr in ($expath/@*, $expath/*, $repo/*) - return - - - - - } - - - - -
app collection:{$config:app-root}
{node-name($attr)}:{$attr/string()}
Controller:{ request:get-attribute("$exist:controller") }
-}; \ No newline at end of file diff --git a/modules/dashboard.xql b/modules/dashboard.xql deleted file mode 100644 index 6a5e921a..00000000 --- a/modules/dashboard.xql +++ /dev/null @@ -1,29 +0,0 @@ -xquery version "3.0"; - -module namespace dash="http://exist-db.org/apps/dashboard"; - -declare namespace expath="http://expath.org/ns/pkg"; -declare namespace repo="http://exist-db.org/xquery/repo"; - -import module namespace config="http://exist-db.org/xquery/apps/config" at "config.xqm"; -import module namespace templates="http://exist-db.org/xquery/templates" at "templates.xql"; -import module namespace packages="http://exist-db.org/apps/dashboard/packages/rest" at "../plugins/packageManager/packages.xql"; - -declare variable $dash:DEFAULTS := doc($config:app-root || "/defaults.xml")/apps; - -declare %templates:wrap function dash:user($node as node(), $model as map(*)) { - let $user := request:get-attribute("org.exist.login.user") - return - if ($user) then - $user - else - "Not logged in" -}; - -declare function dash:list-apps($node as node(), $model as map(*)) { - element { node-name($node) } { - $node/@*, - $node/*, - packages:get("local", "manager", false()) - } -}; \ No newline at end of file diff --git a/modules/get-icon.xql b/modules/get-icon.xql deleted file mode 100644 index c3bf48cc..00000000 --- a/modules/get-icon.xql +++ /dev/null @@ -1,11 +0,0 @@ -xquery version "1.0"; - -let $repo := request:get-parameter("package", ()) -let $iconSvg := repo:get-resource($repo, "icon.svg") -return -if(exists($iconSvg)) -then response:stream-binary($iconSvg, "image/svg+xml", ()) -else ( - let $icon := repo:get-resource($repo, "icon.png") - return response:stream-binary($icon, "image/png", ()) - ) \ No newline at end of file diff --git a/modules/get-packages.xql b/modules/get-packages.xql deleted file mode 100644 index b376e5cc..00000000 --- a/modules/get-packages.xql +++ /dev/null @@ -1,24 +0,0 @@ -xquery version "1.0"; - -(:~ Retrieve package list from server. Needed to work around cross-site-scripting browser restrictions. :) -declare option exist:serialize "method=html media-type=text/html"; - -import module namespace dash="http://exist-db.org/apps/dashboard" at "dashboard.xql"; - -let $url := request:get-parameter("url", ()) -let $baseURL := substring-before($url, "apps.xml") -return - if ($url) then - let $data := httpclient:get($url, false(), ()) - let $status := xs:int($data/@statusCode) - return - if ($status != 200) then - response:set-status-code($status) - else - for $app in $data/httpclient:body//app - return - dash:display-app($baseURL, $app, true()) - else - for $app in dash:installed-apps() - return - dash:display-app((), $app, false()) \ No newline at end of file diff --git a/modules/install.xql b/modules/install.xql deleted file mode 100644 index b4bfecd3..00000000 --- a/modules/install.xql +++ /dev/null @@ -1,141 +0,0 @@ -xquery version "3.0"; - -import module namespace apputil="http://exist-db.org/xquery/apps"; -import module namespace config="http://exist-db.org/xquery/apps/config" at "config.xqm"; -import module namespace request="http://exist-db.org/xquery/request"; -import module namespace response="http://exist-db.org/xquery/response"; -import module namespace util="http://exist-db.org/xquery/util"; -import module namespace xmldb="http://exist-db.org/xquery/xmldb"; - -declare namespace err="http://www.w3.org/2005/xqt-errors"; -declare namespace exist="http://exist.sourceforge.net/NS/exist"; -declare namespace expath="http://expath.org/ns/pkg"; -declare namespace install="http://exist-db.org/apps/dashboard/install"; -declare namespace json="http://www.json.org"; -declare namespace repo="http://exist-db.org/xquery/repo"; - -declare option exist:serialize "method=json media-type=application/json"; - -declare %private function install:require-dba($func as function() as item()*) { - if (xmldb:is-admin-user(xmldb:get-current-user())) then - $func() - else ( - response:set-status-code(403), - {xmldb:get-current-user()} - ) -}; - -declare %private function install:timestamp() as xs:integer { - let $dayZero := xs:dateTime('1970-01-01T00:00:00-00:00') - return - (current-dateTime() - $dayZero) div xs:dayTimeDuration('PT1S') -}; - -let $action := request:get-parameter("action", "install") -let $package-url := request:get-parameter("package-url", ()) -let $version := request:get-parameter("version", ()) -let $server-url := $config:REPO -let $upload := request:get-uploaded-file-name("uploadedfiles[]") -return - install:require-dba(function() { - if (exists($upload) and not($action = ("upgrade-self", "finish-upgrade-self"))) then - try { - let $pkg-metadata := apputil:store-upload() - let $package := $pkg-metadata//expath:package/string(@name) - return - if ($package eq "http://exist-db.org/apps/dashboard") then - (: we are trying to upgrade ourselves i.e. the Dashboard, so we need to take some extra steps :) - let $_ := util:log("info", ("Detected self-upgrade of package: " || $package || ", redirecting...")) - - let $dashboard-col := "/db/apps/" || $pkg-metadata//repo:target - let $modules-col := $dashboard-col || "/modules" - let $upgrade-name := "upgrade_" || install:timestamp() - let $upgrade-query-name := $upgrade-name || ".xq" - - (: we have no copy rename facility to we have to copy, then rename, then copy back, and finally cleanup :) - let $tmp-col := xmldb:create-collection($modules-col, $upgrade-name) - let $_ := xmldb:copy($modules-col, $tmp-col, "install.xql") - let $_ := xmldb:rename($tmp-col, "install.xql", $upgrade-query-name) - let $_ := xmldb:copy($tmp-col, $modules-col, $upgrade-query-name) - let $_ := sm:chmod(xs:anyURI($modules-col || "/" || $upgrade-query-name), "rwxr-xr-x") - let $_ := xmldb:remove($tmp-col) - - return - response:redirect-to(xs:anyURI($upgrade-query-name || "?action=upgrade-self" - || "&package=" || encode-for-uri($package) - || "&repo-path=" || encode-for-uri($pkg-metadata/@repo-path) - || "&file-name=" || encode-for-uri($pkg-metadata/@file-name) - )) - else - let $doc-name := apputil:deploy-upload($pkg-metadata, xs:anyURI($server-url)) - return - - - {$doc-name} - - - - } catch * { - let $_ := util:log("error", ($err:code || " " || $err:description, $err:module || " [" || $err:line-number || ":" || $err:column-number || "]")) - return - - - {($err:description, $err:value)[1]} - - - } - else - switch ($action) - case "upgrade-self" - return - let $package := request:get-parameter("package", ()) - let $repo-path := request:get-parameter("repo-path", ()) - let $file-name := request:get-parameter("file-name", ()) - return - let $doc-name := apputil:deploy-upload($package, $repo-path, $file-name, xs:anyURI($server-url)) - return - response:redirect-to(xs:anyURI("install.xql" || "?action=finish-upgrade-self" - || "&doc-name=" || encode-for-uri($doc-name) - )) - - case "finish-upgrade-self" - return - let $doc-name := request:get-parameter("doc-name", ()) - return - - - {$doc-name} - - - - case "remove" - return - try { - let $type := request:get-parameter("type", ()) - let $removed := apputil:remove($package-url) - return - if ($removed) then - - else - Failed to remove package {$package-url} - } catch * { - {($err:description, $err:value)[1]} - } - - default - return - (: Use dynamic lookup for backwards compatibility :) - let $func := function-lookup(xs:QName("apputil:install-from-repo"), 4) - return - try { - if (empty($func)) then - apputil:install-from-repo($package-url, (), $server-url) - else - $func($package-url, (), $server-url, $version) - } catch * { - - {($err:description, $err:value)[1]} - {$exerr:xquery-stack-trace} - - } - }) \ No newline at end of file diff --git a/modules/login-helper.xql b/modules/login-helper.xql deleted file mode 100644 index 3dac6386..00000000 --- a/modules/login-helper.xql +++ /dev/null @@ -1,55 +0,0 @@ -xquery version "3.0"; - -module namespace login-helper="http://exist-db.org/apps/dashboard/login-helper"; - -(: Determine if the persistent login module is available :) -declare function login-helper:get-login-method() as function(*) { - let $tryImport := - try { - util:import-module(xs:anyURI("http://exist-db.org/xquery/login"), "login", xs:anyURI("resource:org/exist/xquery/modules/persistentlogin/login.xql")), - true() - } catch * { - false() - } - return - if ($tryImport) then - function-lookup(xs:QName("login:set-user"), 3) - else - login-helper:fallback-login#3 -}; - -(:~ - Fallback login function used when the persistent login module is not available. - Stores user/password in the HTTP session. - :) -declare %private function login-helper:fallback-login($domain as xs:string, $maxAge as xs:dayTimeDuration?, $asDba as xs:boolean) { - let $durationParam := request:get-parameter("duration", ()) - let $user := request:get-parameter("user", ()) - let $password := request:get-parameter("password", ()) - let $logout := request:get-parameter("logout", ()) - return - if ($durationParam) then - error(xs:QName("login"), "Persistent login module not enabled in this version of eXist-db") - else if ($logout) then - session:invalidate() - else - if ($user) then - let $isLoggedIn := xmldb:login("/db", $user, $password, true()) - return - if ($isLoggedIn and (not($asDba) or xmldb:is-admin-user($user))) then ( - session:set-attribute("eXide.user", $user), - session:set-attribute("eXide.password", $password), - request:set-attribute($domain || ".user", $user), - request:set-attribute("xquery.user", $user), - request:set-attribute("xquery.password", $password) - ) else - () - else - let $user := session:get-attribute("eXide.user") - let $password := session:get-attribute("eXide.password") - return ( - request:set-attribute($domain || ".user", $user), - request:set-attribute("xquery.user", $user), - request:set-attribute("xquery.password", $password) - ) -}; \ No newline at end of file diff --git a/modules/restxq.xql b/modules/restxq.xql deleted file mode 100644 index 4724d3d8..00000000 --- a/modules/restxq.xql +++ /dev/null @@ -1,419 +0,0 @@ -(: - : RESTful Annotations for XQuery (RESTXQ) in plain XQuery. Temporary solution until - : the Java implementation is available. - : - : Copyright (C) 2012 Wolfgang Meier - : http://existsolutions.com - : - : This program is free software; you can redistribute it and/or - : modify it under the terms of the GNU Lesser General Public License - : as published by the Free Software Foundation; either version 2 - : of the License, or (at your option) any later version. - : - : This program is distributed in the hope that it will be useful, - : but WITHOUT ANY WARRANTY; without even the implied warranty of - : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - : GNU Lesser General Public License for more details. - : - : You should have received a copy of the GNU Lesser General Public - : License along with this library; if not, write to the Free Software - : Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - : - : $Id$ - :) - -xquery version "3.0"; - -(:~ - : An implementation of RESTful Annotations for XQuery (RESTXQ) in plain - : XQuery. Most of this code is standard XQuery 3.0 with map extension, - : except for the function used to inspect a function signature and the - : calls to the HTTP request module. - : - : This started as a temporary solution until the Java implementation was - : available, but I now use it as a quick fallback when I don't want to or - : cannot enable the restxq trigger. - : - : @author Wolfgang Meier - :) -module namespace restxq="http://exist-db.org/xquery/restxq"; - -declare variable $restxq:NAMESPACE := "http://exquery.org/ns/restxq"; -(: - : Define a second namespace for the annotations which can be used in cases - : where annotations would conflict with the Java restxq. - :) -declare variable $restxq:EXTENSION_NAMESPACE := "http://exist-db.org/ns/rest/annotation/xquery"; - -declare variable $restxq:OUTPUT_NAMESPACE :="http://www.w3.org/2010/xslt-xquery-serialization"; - -declare variable $restxq:WRONG_ARG_COUNT := QName($restxq:NAMESPACE, "wrong-number-of-arguments"); -declare variable $restxq:TOO_MANY_ARGS := QName($restxq:NAMESPACE, "too-many-arguments"); -declare variable $restxq:TYPE_ERROR := QName($restxq:NAMESPACE, "type-error"); -declare variable $restxq:AMBIGUOUS := QName($restxq:NAMESPACE, "ambiguous"); -declare variable $restxq:UNKNOWN := QName($restxq:NAMESPACE, "unknown-annotation"); - -declare variable $restxq:OUTPUT_MEDIA_TYPE := QName($restxq:OUTPUT_NAMESPACE, "media-type"); -declare variable $restxq:OUTPUT_METHOD := QName($restxq:OUTPUT_NAMESPACE, "method"); - -declare variable $restxq:ERROR_IF_AMBIGUOUS := false(); - -(:~ - : Main entry point: takes a sequence of functions and tries to match them - : against the current HTTP request by inspecting their %rest annotations. - : - : @param $path-info the HTTP request path to compare with in %restxq:path. If empty, - : we'll use the value returned by request:get-path-info(), i.e. any extra path - : information in the URL after the path leading to the called XQuery. If you call - : restxq from a controller.xql, you probably want to pass $exist:path as $path-info. - : - : @param $functions the sequence of function items to inspect, usually obtained - : by calling util:list-functions on a module URI. - :) -declare function restxq:process($path-info as xs:string?, $functions as function(*)+) { - let $params := map { - "$restxq:path" := - if (exists($path-info)) then - $path-info - else - request:get-path-info() - } - let $log := util:log("DEBUG", "Processing path " || $params("$restxq:path")) - return - restxq:function-by-annotation($functions, $params, function($function as function(*), $meta as element(function), $params as map(*)) { - let $arguments := restxq:map-arguments($meta, $params) - return ( - restxq:set-serialization($meta), - util:log("DEBUG", "Calling function " || function-name($function)), - restxq:call-with-args($function, $arguments) - ) - }) -}; - -(:~ - : Find functions with annotations matching the current HTTP request. Call the supplied - : callback function for each matching function found. - :) -declare %private function restxq:function-by-annotation($functions as function(*)+, $params as map(*), - $callback as function(function(*), element(function), map(*)) as item()*) { - (: Create a map first, so we can count how many functions match - : and throw an error if there's more than one :) - let $matchingFunctions := - for $function in $functions - let $meta := util:inspect-function($function) - let $annotations := $meta/annotation[@namespace = ($restxq:NAMESPACE, $restxq:EXTENSION_NAMESPACE)] - return - if (empty($annotations)) then - () - else - let $params := restxq:find-matching-annotations($annotations, $params) - return - if (empty($params)) then - () - else - map { - "function" := $function, - "meta" := $meta, - "params" := $params - } - return - (: More than one function found: throw an error :) - if (count($matchingFunctions) > 1 and $restxq:ERROR_IF_AMBIGUOUS) then - error($restxq:AMBIGUOUS, "More than one function matches the request: " || - string-join(for $f in $matchingFunctions return function-name($f("function")), ", ")) - else - (: If there are multiple matching functions, choose the one with the larger - : number of annotations. :) - let $fOrdered := - for $f in $matchingFunctions - order by count($f("meta")/annotation) descending - return - $f - for $f in $fOrdered[1] - return - $callback($f("function"), $f("meta"), $f("params")) -}; - -(:~ - : Process the given %rest annotation. Returns the empty sequence if the annotation - : is constraining and does not match the current HTTP request, or a map of parameters - : otherwise. - :) -declare %private function restxq:match-annotation($anno as element(annotation), $params as map(*)) as map(*)? { - let $method := substring-after($anno/@name, ":") - return - switch($method) - case "path" return - restxq:path($anno, $params) - case "GET" case "DELETE" case "HEAD" return - restxq:method($method, $anno, $params) - case "POST" case "PUT" return - restxq:post($anno, $method, $params) - case "consumes" return - restxq:consumes($anno, $params) - case "produces" return - restxq:produces($anno, $params) - case "query-param" case "form-param" return - restxq:query-param($anno, $params) - case "header-param" return - restxq:header-param($anno, $params) - default return - error($restxq:UNKNOWN, concat("Unknown annotation: ", $anno/@name)) -}; - -(:~ - : Handles %restxq:GET, %restxq:DELETE - :) -declare %private function restxq:method($method as xs:string, $anno as element(annotation), $params as map(*)) as map(*)? { - if (upper-case(request:get-method()) = $method) then - $params - else - () -}; - -(:~ - : %restxq:POST(param) - :) -declare %private function restxq:post($anno as element(annotation), $method as xs:string, $params as map(*)) { - if (not(upper-case(request:get-method()) = $method)) then - () - else - let $value := $anno/value - return - if (empty($value)) then - $params - else - let $var := restxq:extract-variable($value) - return - if ($var) then - let $accessor := function() { request:get-data() } - return - map:merge(($params, map:entry($var, $accessor))) - else - $params -}; - -(:~ - : %restxq:consumes(media-type1, media-type2) - :) -declare %private function restxq:consumes($anno as element(annotation), $params as map(*)) as map(*)? { - let $types := $anno/value/string() - let $content-type := request:get-header("Content-Type") - return - (: = returns true if one of the items in the $types sequence is equal to $content-type :) - if ($content-type = $types) then - $params - else - () -}; - -(:~ - : %restxq:produces(media-type1, media-type2) - :) -declare %private function restxq:produces($anno as element(annotation), $params as map(*)) { - let $header := request:get-header("Accept") - let $header := if (contains($header, ";")) then substring-before($header, ";") else $header - let $types := tokenize($header, "\s*,\s*") - let $produces := $anno/value/string() - let $produces := if (exists($produces)) then $produces else "text/xml" - return - if (some $type in $produces satisfies $type = $types) then - $params - else - () -}; - -(:~ - : %restxq:query-param(reqParam, funcParam, default) - :) -declare %private function restxq:query-param($anno as element(annotation), $params as map(*)) as map(*)? { - let $paramName := $anno/value[1]/string() - let $var := restxq:extract-variable($anno/value[2]/string()) - let $default := if ($anno/value[3]) then $anno/value[3]/string() else () - let $param := request:get-parameter($paramName, $default) - return - map:merge(($params, map:entry($var, $param))) -}; - -(:~ - : %restxq:header-param(reqParam, funcParam) - :) -declare %private function restxq:header-param($anno as element(annotation), $params as map(*)) as map(*)? { - let $headerName := $anno/value[1]/string() - let $var := restxq:extract-variable($anno/value[2]/string()) - let $header := request:get-header($headerName) - return - map:merge(($params, map:entry($var, $header))) -}; - -(:~ - : %restxq:path(path) - :) -declare %private function restxq:path($anno as element(annotation), $params as map(*)) as map(*)? { - let $path := $params("$restxq:path") - let $annoPath := $anno/value[1]/string() - let $match := restxq:match-path($params, $path, $annoPath) - return - $match -}; - -(:~ - : Compare the input path to a path template with (optional) variable substitutions. - : Returns the empty sequence if the path does not match or a map containing - : the substituted variables and their values. - :) -declare %private function restxq:match-path($params as map(*), $input as xs:string, $template as xs:string) as map(*)? { - let $regex := "^" || replace($template, "\{\$([^\}]+)\}", ".*") || "/?$" - let $log := util:log("DEBUG", "$input: " || $input || " $template: " || $template || " $regex: " || $regex) - return - if (matches($input, $regex)) then - let $groupsRegex := "^" || replace($template, "\{\$([^\}]+)\}", "(.*)") || "$" - let $groups := analyze-string($input, $groupsRegex)//fn:group/string() - let $analyzed := analyze-string($template, "\{\$[^\}]+\}") - return - map:merge(( - $params, - for-each-pair($groups, $analyzed//fn:match, - function($group, $varExpr) { - let $var := replace($varExpr, "\{\$([^\}]+)\}", "$1") - return - map:entry($var, $group) - }) - )) - else - () -}; - -(:~ - : Recursively inspect all rest annotations of a function and try to match them against the request. - :) -declare %private function restxq:find-matching-annotations($annotations as element(annotation)*, $params as map(*)) { - if (empty($annotations)) then - $params - else - let $params := restxq:match-annotation(head($annotations), $params) - return - if (exists($params)) then - let $tail := tail($annotations) - return ( - (: Bug: recursive call doesn't work if () is removed :) - (), - restxq:find-matching-annotations($tail, $params) - ) - else - () -}; - -(:~ - : Try to fill in the function arguments using the values supplied in the paramter map. - :) -declare %private function restxq:map-arguments($inspect as element(function), $params as map(*)) { - $inspect/argument ! restxq:map-argument(., $params) -}; - -(:~ - : Try to fill a single function argument using the values supplied in the parameter map. - : Attempts type conversion by casting the parameter to the required function argument type. - :) -declare %private function restxq:map-argument($arg as element(argument), $params as map(*)) as function() as item()* { - let $var := $arg/@var - let $type := $arg/@type/string() - return - if (map:contains($params, $var)) then - let $param := $params($var) - let $value := if ($param instance of function(*)) then $param() else $param - let $data := - try { - restxq:cast($value, $type) - } catch * { - error($restxq:TYPE_ERROR, "Failed to cast parameter value '" || $value || "' to the required target type for " || - "function parameter $" || $var || " of function " || ($arg/../@name) || ". Required type was: " || - $type || ". " || $err:description) - } - return - function() { $data } - else - error($restxq:TYPE_ERROR, "Cannot determine value for function parameter $" || $var) -}; - -declare %private function restxq:cast($values as item()*, $targetType as xs:string) { - for $value in $values - return - if ($targetType != "xs:string" and string-length($value) = 0) then - (: treat "" as empty sequence :) - () - else - switch ($targetType) - case "xs:string" return - string($value) - case "xs:integer" case "xs:int" case "xs:long" return - xs:integer($value) - case "xs:decimal" return - xs:decimal($value) - case "xs:float" case "xs:double" return - xs:double($value) - case "xs:date" return - xs:date($value) - case "xs:dateTime" return - xs:dateTime($value) - case "xs:time" return - xs:time($value) - case "element()" return - parse-xml($value)/* - case "text()" return - text { string($value) } - default return - $value -}; - -(:~ - : Call the supplied function using the argument sequence. Arguments are provided - : as function items, so we can 1) use sequences, 2) postpone argument computation - : until the actual call. - :) -declare %private function restxq:call-with-args($fn as function(*), $args as (function() as item()*)*) { - switch (count($args)) - case 0 return - $fn() - case 1 return - $fn($args[1]()) - case 2 return - $fn($args[1](), $args[2]()) - case 3 return - $fn($args[1](), $args[2](), $args[3]()) - case 4 return - $fn($args[1](), $args[2](), $args[3](), $args[4]()) - case 5 return - $fn($args[1](), $args[2](), $args[3](), $args[4](), $args[5]()) - case 6 return - $fn($args[1](), $args[2](), $args[3](), $args[4](), $args[5](), $args[6]()) - case 7 return - $fn($args[1](), $args[2](), $args[3](), $args[4](), $args[5](), $args[6](), $args[7]()) - case 8 return - $fn($args[1](), $args[2](), $args[3](), $args[4](), $args[5](), $args[6](), $args[7](), $args[8]()) - default return - error($restxq:TOO_MANY_ARGS, "Too many arguments to function " || function-name($fn)) -}; - -declare %private function restxq:extract-variable($param as xs:string) as xs:string { - if (matches($param, "\{\$[^\}]+\}")) then - replace($param, "^.*\{\$([^\}]+)\}.*$", "$1") - else - () -}; - -declare %private function restxq:get-annotation($meta as element(function), $annotation as xs:QName) as xs:string* { - $meta/annotation[@namespace = namespace-uri-from-QName($annotation)] - [substring-after(@name, ":") = local-name-from-QName($annotation)]/value/string() -}; - -declare %private function restxq:set-serialization($meta as element(function)) { - let $serializeStr := - $meta/annotation[@namespace = $restxq:OUTPUT_NAMESPACE] ! - concat(substring-after(@name, ":"), "=", value[1]/string()) - return - if (exists($serializeStr)) then - util:declare-option("exist:serialize", string-join($serializeStr, " ")) - else - () -}; \ No newline at end of file diff --git a/modules/templates.xql b/modules/templates.xql deleted file mode 100644 index f7ef30ba..00000000 --- a/modules/templates.xql +++ /dev/null @@ -1,504 +0,0 @@ -xquery version "3.0"; - -module namespace templates="http://exist-db.org/xquery/templates"; - -(:~ - : HTML templating module - : - : @version 2.0 - : @author Wolfgang Meier -:) -import module namespace config="http://exist-db.org/xquery/apps/config" at "config.xqm"; - -declare variable $templates:CONFIG_STOP_ON_ERROR := "stop-on-error"; - -declare variable $templates:CONFIGURATION := "configuration"; -declare variable $templates:CONFIGURATION_ERROR := QName("http://exist-db.org/xquery/templates", "ConfigurationError"); -declare variable $templates:NOT_FOUND := QName("http://exist-db.org/xquery/templates", "NotFound"); -declare variable $templates:TOO_MANY_ARGS := QName("http://exist-db.org/xquery/templates", "TooManyArguments"); -declare variable $templates:PROCESSING_ERROR := QName("http://exist-db.org/xquery/templates", "ProcessingError"); -declare variable $templates:TYPE_ERROR := QName("http://exist-db.org/xquery/templates", "TypeError"); - -declare variable $templates:root-collection := - let $root := request:get-attribute("templating.root") - return - if ($root) then $root else $config:app-root -; - -(:~ - : Start processing the provided content. Template functions are looked up by calling the - : provided function $resolver. The function should take a name as a string - : and return the corresponding function item. The simplest implementation of this function could - : look like this: - : - :
function($functionName as xs:string, $arity as xs:int) { function-lookup(xs:QName($functionName), $arity) }
- : - : @param $content the sequence of nodes which will be processed - : @param $resolver a function which takes a name and returns a function with that name - : @param $model a sequence of items which will be passed to all called template functions. Use this to pass - : information between templating instructions. -:) -declare function templates:apply($content as node()+, $resolver as function(xs:string, xs:int) as item()?, $model as map(*)?, - $configuration as map(*)?) { - let $model := if ($model) then $model else map {} - let $configuration := - if (exists($configuration)) then - map:merge(($configuration, map { "resolve" := $resolver })) - else - map { "resolve" := $resolver } - let $model := map:merge(($model, map:entry($templates:CONFIGURATION, $configuration))) - for $root in $content - return - templates:process($root, $model) -}; - -declare function templates:apply($content as node()+, $resolver as function(xs:string, xs:int) as item()?, $model as map(*)?) { - templates:apply($content, $resolver, $model, ()) -}; - -(:~ - : Continue template processing on the given set of nodes. Call this function from - : within other template functions to enable recursive processing of templates. - : - : @param $nodes the nodes to process - : @param $model a sequence of items which will be passed to all called template functions. Use this to pass - : information between templating instructions. -:) -declare function templates:process($nodes as node()*, $model as map(*)) { - let $config := templates:get-configuration($model, "") - for $node in $nodes - return - typeswitch ($node) - case document-node() return - for $child in $node/node() return templates:process($child, $model) - case element() return - let $instructions := templates:get-instructions($node/@class) - return - if ($instructions) then - for $instruction in $instructions - return - templates:call($instruction, $node, $model) - else - element { node-name($node) } { - $node/@*, for $child in $node/node() return templates:process($child, $model) - } - default return - $node -}; - -declare %private function templates:get-instructions($class as xs:string?) as xs:string* { - for $name in tokenize($class, "\s+") - where templates:is-qname($name) - return - $name -}; - -declare %private function templates:get-configuration($model as map(*), $func as xs:string) { - if (not(map:contains($model, $templates:CONFIGURATION))) then - error($templates:CONFIGURATION_ERROR, "Configuration map not found in model. Tried to call: " || $func) - else - $model($templates:CONFIGURATION) -}; - -declare %private function templates:call($class as xs:string, $node as element(), $model as map(*)) { - let $paramStr := substring-after($class, "?") - let $parameters := templates:parse-parameters($paramStr) - let $func := if ($paramStr) then substring-before($class, "?") else $class - let $config := templates:get-configuration($model, $func) - let $call := templates:resolve($func, $config("resolve")) - return - if (exists($call)) then - templates:call-by-introspection($node, $parameters, $model, $call) - else if ($model($templates:CONFIGURATION)("stop-on-error")) then - error($templates:NOT_FOUND, "No template function found for call " || $func) - else - (: Templating function not found: just copy the element :) - element { node-name($node) } { - $node/@*, for $child in $node/node() return templates:process($child, $model) - } -}; - -declare %private function templates:call-by-introspection($node as element(), $parameters as map(xs:string, xs:string), $model as map(*), - $fn as function(*)) { - let $inspect := util:inspect-function($fn) - let $args := templates:map-arguments($inspect, $parameters) - return - templates:process-output( - $node, - $model, - templates:call-with-args($fn, $args, $node, $model), - $inspect - ) -}; - -declare %private function templates:call-with-args($fn as function(*), $args as (function() as item()*)*, - $node as element(), $model as map(*)) { - switch (count($args)) - case 0 return - $fn($node, $model) - case 1 return - $fn($node, $model, $args[1]()) - case 2 return - $fn($node, $model, $args[1](), $args[2]()) - case 3 return - $fn($node, $model, $args[1](), $args[2](), $args[3]()) - case 4 return - $fn($node, $model, $args[1](), $args[2](), $args[3](), $args[4]()) - case 5 return - $fn($node, $model, $args[1](), $args[2](), $args[3](), $args[4](), $args[5]()) - case 6 return - $fn($node, $model, $args[1](), $args[2](), $args[3](), $args[4](), $args[5](), $args[6]()) - case 7 return - $fn($node, $model, $args[1](), $args[2](), $args[3](), $args[4](), $args[5](), $args[6](), $args[7]()) - case 8 return - $fn($node, $model, $args[1](), $args[2](), $args[3](), $args[4](), $args[5](), $args[6](), $args[7](), $args[8]()) - default return - error($templates:TOO_MANY_ARGS, "Too many arguments to function " || function-name($fn)) -}; - -declare %private function templates:process-output($node as element(), $model as map(*), $output as item()*, - $inspect as element(function)) { - let $wrap := - $inspect/annotation[ends-with(@name, ":wrap")] - [@namespace = "http://exist-db.org/xquery/templates"] - return - if ($wrap) then - element { node-name($node) } { - $node/@*, - templates:process-output($node, $model, $output) - } - else - templates:process-output($node, $model, $output) -}; - -declare %private function templates:process-output($node as element(), $model as map(*), $output as item()*) { - typeswitch($output) - case map(*) return - templates:process($node/node(), map:merge(($model, $output))) - default return - $output -}; - -declare %private function templates:map-arguments($inspect as element(function), $parameters as map(xs:string, xs:string)) { - let $args := $inspect/argument - return - if (count($args) > 2) then - for $arg in subsequence($args, 3) - return - templates:map-argument($arg, $parameters) - else - () -}; - -declare %private function templates:map-argument($arg as element(argument), $parameters as map(xs:string, xs:string)) - as function() as item()* { - let $var := $arg/@var - let $type := $arg/@type/string() - let $paramFromContext := - ( - request:get-parameter($var, ()), - $parameters($var) - )[1] - let $param := - if ($paramFromContext) then - $paramFromContext - else - templates:arg-from-annotation($var, $arg) - let $data := - try { - templates:cast($param, $type) - } catch * { - error($templates:TYPE_ERROR, "Failed to cast parameter value '" || $param || "' to the required target type for " || - "template function parameter $" || $var || " of function " || ($arg/../@name) || ". Required type was: " || - $type || ". " || $err:description) - } - return - function() { - $data - } -}; - -declare %private function templates:arg-from-annotation($var as xs:string, $arg as element(argument)) { - let $anno := - $arg/../annotation[ends-with(@name, ":default")] - [@namespace = "http://exist-db.org/xquery/templates"] - [value[1] = $var] - for $value in subsequence($anno/value, 2) - return - string($value) -}; - -declare %private function templates:resolve($func as xs:string, $resolver as function(xs:string, xs:int) as function(*)) { - templates:resolve(2, $func, $resolver) -}; - -declare %private function templates:resolve($arity as xs:int, $func as xs:string, - $resolver as function(xs:string, xs:int) as function(*)) { - if ($arity > 10) then - () - else - let $fn := $resolver($func, $arity) - return - if (exists($fn)) then - $fn - else - templates:resolve($arity + 1, $func, $resolver) -}; - -declare %private function templates:parse-parameters($paramStr as xs:string?) as map(xs:string, xs:string) { - map:merge( - for $param in tokenize($paramStr, "&") - let $key := substring-before($param, "=") - let $value := substring-after($param, "=") - where $key - return - map:entry($key, $value) - ) -}; - -declare %private function templates:is-qname($class as xs:string) as xs:boolean { - matches($class, "^[^:]+:[^:]+") -}; - -declare %private function templates:cast($values as item()*, $targetType as xs:string) { - for $value in $values - return - if ($targetType != "xs:string" and string-length($value) = 0) then - (: treat "" as empty sequence :) - () - else - switch ($targetType) - case "xs:string" return - string($value) - case "xs:integer" case "xs:int" case "xs:long" return - xs:integer($value) - case "xs:decimal" return - xs:decimal($value) - case "xs:float" case "xs:double" return - xs:double($value) - case "xs:date" return - xs:date($value) - case "xs:dateTime" return - xs:dateTime($value) - case "xs:time" return - xs:time($value) - case "element()" return - parse-xml($value)/* - case "text()" return - text { string($value) } - default return - $value -}; - -(:----------------------------------------------------------------------------------- - : Standard templates - :-----------------------------------------------------------------------------------:) - -declare function templates:include($node as node(), $model as map(*), $path as xs:string) { - let $path := - if (starts-with($path, "/")) then - (: Search template relative to app root :) - concat($config:app-root, "/", $path) - else - (: Locate template relative to HTML file :) - concat($templates:root-collection, "/", $path) - return - templates:process(doc($path), $model) - -}; - -declare function templates:surround($node as node(), $model as map(*), $with as xs:string, $at as xs:string?, $using as xs:string?) { - let $path := - if (starts-with($with, "/")) then - (: Search template relative to app root :) - concat($config:app-root, $with) - else - (: Locate template relative to HTML file :) - concat($templates:root-collection, "/", $with) - let $content := - if ($using) then - doc($path)//*[@id = $using] - else - doc($path) - let $merged := templates:process-surround($content, $node, $at) - return - templates:process($merged, $model) -}; - -declare %private function templates:process-surround($node as node(), $content as node(), $at as xs:string) { - typeswitch ($node) - case document-node() return - for $child in $node/node() return templates:process-surround($child, $content, $at) - case element() return - if ($node/@id eq $at) then - element { node-name($node) } { - $node/@*, $content/node() - } - else - element { node-name($node) } { - $node/@*, for $child in $node/node() return templates:process-surround($child, $content, $at) - } - default return - $node -}; - -declare function templates:if-parameter-set($node as node(), $model as map(*), $param as xs:string) as node()* { - let $param := request:get-parameter($param, ()) - return - if ($param and string-length($param) gt 0) then - templates:process($node/node(), $model) - else - () -}; - -declare function templates:if-parameter-unset($node as node(), $model as item()*, $param as xs:string) as node()* { - let $param := request:get-parameter($param, ()) - return - if (not($param) or string-length($param) eq 0) then - $node - else - () -}; - -declare function templates:if-attribute-set($node as node(), $model as map(*), $attribute as xs:string) { - let $isSet := - (exists($attribute) and request:get-attribute($attribute)) - return - if ($isSet) then - templates:process($node/node(), $model) - else - () -}; - -declare function templates:if-module-missing($node as node(), $model as map(*), $uri as xs:string, $at as xs:string) { - try { - util:import-module($uri, "testmod", $at) - } catch * { - (: Module was not found: process content :) - templates:process($node/node(), $model) - } -}; - -declare function templates:display-source($node as node(), $model as map(*), $lang as xs:string?) { - let $source := replace($node/string(), "^\s*(.*)\s*$", "$1") - let $context := request:get-context-path() - let $eXidePath := if (doc-available("/db/eXide/index.html")) then "apps/eXide" else "eXide" - return -
-
-            { $source }
-            
- Try it -
-}; - -declare function templates:load-source($node as node(), $model as map(*)) as node()* { - let $href := $node/@href/string() - let $context := request:get-context-path() - let $eXidePath := if (doc-available("/db/eXide/index.html")) then "apps/eXide" else "eXide" - return - {$node/node()} -}; - -(:~ - Processes input and select form controls, setting their value/selection to - values found in the request - if present. - :) -declare function templates:form-control($node as node(), $model as map(*)) as node()* { - typeswitch ($node) - case element(input) return - let $name := $node/@name - let $value := request:get-parameter($name, ()) - return - if ($value) then - element { node-name($node) } { - $node/@* except $node/@value, - attribute value { $value }, - $node/node() - } - else - $node - case element(select) return - let $value := request:get-parameter($node/@name/string(), ()) - return - element { node-name($node) } { - $node/@* except $node/@class, - for $option in $node/option - return - - } - default return - $node -}; - -declare function templates:error-description($node as node(), $model as map(*)) { - let $input := request:get-attribute("org.exist.forward.error") - return - element { node-name($node) } { - $node/@*, - parse-xml($input)//message/string() - } -}; - -declare function templates:expand-links($node as node(), $model as map(*), $external as xs:string?) { - templates:expand-links($node, $external) -}; - -declare %private function templates:expand-links($node as node(), $external as xs:string?) { - typeswitch ($node) - case element(a) return - let $href := $node/@href - let $expanded := - if (starts-with($href, "/")) then - concat(request:get-context-path(), $href) - else - templates:expand-link($href, $external) - return - - { $node/@* except $href, $node/node() } - - case element() return - element { node-name($node) } { - $node/@*, for $child in $node/node() return templates:expand-links($child, $external) - } - default return - $node -}; - -declare %private function templates:expand-link($href as xs:string, $external as xs:string?) { - string-join( - let $analyzed := analyze-string($href, "^\{([^\{\}]+)\}") - for $component in $analyzed/*/* - let $log := util:log("DEBUG", ("Component: ", $component)) - return - typeswitch($component) - case element(fn:match) return - let $name := $component/fn:group/string() - let $app := collection(concat("/db/", $name)) - return - if ($app) then - concat(request:get-context-path(), request:get-attribute("$exist:prefix"), "/", $name) - else - $external - default return - $component/text() - , "" - ) -}; - -declare function templates:copy-node($node as element(), $model as item()*) { - element { node-name($node) } { - $node/@*, - templates:process($node/*, $model) - } -}; \ No newline at end of file diff --git a/modules/view.xql b/modules/view.xql deleted file mode 100644 index 5432b6d1..00000000 --- a/modules/view.xql +++ /dev/null @@ -1,38 +0,0 @@ -(:~ - : This is the main XQuery which will (by default) be called by controller.xql - : to process any URI ending with ".html". It receives the HTML from - : the controller and passes it to the templating system. - :) -xquery version "3.0"; - -import module namespace templates="http://exist-db.org/xquery/templates" at "templates.xql"; - -(: - : The following modules provide functions which will be called by the - : templating. - :) -import module namespace config="http://exist-db.org/xquery/apps/config" at "config.xqm"; -import module namespace dash="http://exist-db.org/apps/dashboard" at "dashboard.xql"; - -declare option exist:serialize "method=html5 media-type=text/html"; - -(: - : We have to provide a lookup function to templates:apply to help it - : find functions in the imported application modules. The templates - : module cannot see the application modules, but the inline function - : below does see them. - :) -let $lookup := function($functionName as xs:string, $arity as xs:int) { - try { - function-lookup(xs:QName($functionName), $arity) - } catch * { - () - } -} -(: - : The HTML is passed in the request from the controller. - : Run it through the templating system and return the result. - :) -let $content := request:get-data() -return - templates:apply($content, $lookup, ()) diff --git a/plugins/backup/backup.css b/plugins/backup/backup.css deleted file mode 100644 index d33aa6fc..00000000 --- a/plugins/backup/backup.css +++ /dev/null @@ -1,19 +0,0 @@ -.backup .backup-list #backup-grid { - margin: 0 auto 10px auto; - height: 400px; -} -.backup .backup-list .toolbar img { - height: 24px; -} -.backup #backup-form { - margin: 0 10px; -} -.backup #backup-form ul { - list-style: none; - margin: 18px 0; - padding: 0; -} -.backup #backup-form ul li { - margin: 8px 0 0 0; - padding: 0; -} diff --git a/plugins/backup/backup.html b/plugins/backup/backup.html deleted file mode 100644 index 691d76aa..00000000 --- a/plugins/backup/backup.html +++ /dev/null @@ -1,29 +0,0 @@ - -
-
- - -
-
-
-
-
-
    -
  • - Zip (Don't use for database with more than 4gb)
  • -
  • - Incremental
  • -
  • - - -
  • -
-

A backup has been triggered on the server! If it has not been processed immediately, - it will be created once all write transactions have completed. -

-
-
\ No newline at end of file diff --git a/plugins/backup/backup.js b/plugins/backup/backup.js deleted file mode 100644 index 78f8cb05..00000000 --- a/plugins/backup/backup.js +++ /dev/null @@ -1,123 +0,0 @@ -define([ - "plugins/base", - "dojo/_base/declare", - "dojo/dom", - "dojo/on", - "dojo/_base/array", - "dojo/query", - "dojox/fx", - "dojo/parser", - "dijit/registry", - "dojox/grid/DataGrid", - "dojox/data/JsonRestStore", - "dijit/form/CheckBox", - "dijit/Toolbar", - "dojox/widget/Standby" - ], - function(plugin, declare, dom, on, array, query, fx, parser, registry) { - - /** - * Backup plugin. View available backups or trigger a new one. - */ - return declare(plugin, { - pluginName:"Backup Central", - - store: null, - grid: null, - - constructor: function(div) { - this.inherited(arguments); - }, - - init: function() { - this.inherited(arguments); - this.loadCSS("plugins/backup/backup.css"); - - var $this = this; - - // json data store - this.store = new dojox.data.JsonRestStore({target:"plugins/backup/backup.xql", idAttribute:"id"}); - - /*set up layout*/ - var layout = [[ - {'name': 'Name', 'field': 'name', 'width': '40%%'}, - {'name': 'Created', 'field': 'created', 'width': '40%'}, - {'name': 'Incremental', 'field': 'incremental', 'width': '20%'} - ]]; - - /*create a new grid:*/ - this.grid = new dojox.grid.DataGrid( - { - id: 'backup-grid', - store: this.store, - structure: layout, - autoWidth: false, - autoHeight: 8, - selectionMode: "single" - }, - document.createElement('div')); - - /*append the new grid to the div*/ - dojo.byId("backup-grid-container").appendChild(this.grid.domNode); - - this.grid.startup(); - - /* connect the refresh button */ - query(".refresh", this.container).on("click", function(ev) { - ev.preventDefault(); - $this.refresh(); - }); - /* download button */ - query(".download", this.container).on("click", function(ev) { - ev.preventDefault(); - var items = $this.grid.selection.getSelected(); - var href = window.location.href; - href = href.replace(/^(.*)\/exist\/(.*)\/[^\/]*$/, "$1/exist/$2"); - window.location.href = href + "/plugins/backup/backup.xql?action=retrieve&archive=" + items[0].name; - }); - - var form = dom.byId("backup-form"); - on(form, "submit", function(e) { - e.preventDefault(); - $this.actionStart(); - dojo.xhrPost({ - url: "plugins/backup/backup.xql", - form: form, - handleAs: "json", - load: function(data) { - $this.actionEnd(); - $this.showMessage(); - $this.refresh(); - }, - error: function(error, ioargs) { - $this.actionEnd(); - $this.showMessage("An error occurred while communicating with the server!"); - } - }); - }); - - this.ready(); - }, - - close: function() { - this.inherited(arguments); - - grid = null; - store = null; - }, - - refresh: function() { - this.store.close(); - this.grid.setStore(this.store); - }, - - showMessage: function(message) { - var msg = query(".message-info", this.container); - if (message) { - msg[0].innerHTML = message; - } - var anim = msg.fadeIn(); - anim.play(); - } - }); -}); diff --git a/plugins/backup/backup.less b/plugins/backup/backup.less deleted file mode 100644 index 5b23c146..00000000 --- a/plugins/backup/backup.less +++ /dev/null @@ -1,29 +0,0 @@ -@lightGreyBase: #6d6e70;//original existdb lighter gray - -.backup { - - .backup-list { - #backup-grid { - margin: 0 auto 10px auto; - height: 400px; - } - .toolbar img { - height: 24px; - } - } - - #backup-form { - margin: 0 10px; - - ul { - list-style: none; - margin: 18px 0; - padding: 0; - - li { - margin: 8px 0 0 0; - padding: 0; - } - } - } -} \ No newline at end of file diff --git a/plugins/backup/backup.xql b/plugins/backup/backup.xql deleted file mode 100644 index 1d8ac32c..00000000 --- a/plugins/backup/backup.xql +++ /dev/null @@ -1,71 +0,0 @@ -xquery version "3.0"; - -import module namespace backups="http://exist-db.org/xquery/backups" - at "java:org.exist.backup.xquery.BackupModule"; - -declare namespace backup="http://exist-db.org/apps/dashboard/backup"; -declare namespace json="http://www.json.org"; - -declare option exist:serialize "method=json media-type=application/json"; - - -declare variable $backup:BACKUP_DIR := "export"; - -declare function backup:list() { - let $backups := backups:list($backup:BACKUP_DIR)/exist:backup - return ( - response:set-header("Content-Range", "items 0-" || count($backups) || "/" || count($backups)), - if (empty($backups)) then - - else - - { - for $backup in $backups - return - - {$backup/@file/string()} - {$backup/exist:date/string()} - {$backup/exist:incremental/text()} - - } - - ) -}; - -declare function backup:trigger() { - let $zip := request:get-parameter("zip", ()) - let $incremental := request:get-parameter("inc", ()) - let $params := - - - - - - - return ( - system:trigger-system-task("org.exist.storage.ConsistencyCheckTask", $params), - - ) -}; - -declare function backup:retrieve() { - let $archive := request:get-parameter("archive", ()) - return ( - request:set-attribute("betterform.filter.ignoreResponseBody", "true"), - if ($archive) then ( - response:set-header("Content-Disposition", concat("attachment; filename=", $archive)), - backups:retrieve($backup:BACKUP_DIR, $archive) - ) else - () - ) - -}; - -let $action := request:get-parameter("action", ()) -return - if ($action = "trigger") then - backup:trigger() - else if ($action = "retrieve") then - backup:retrieve() - else - backup:list() \ No newline at end of file diff --git a/plugins/backup/images/application_get.png b/plugins/backup/images/application_get.png deleted file mode 100644 index 28e41ea2bb469397b2905fc8272b287101fd44bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 581 zcmV-L0=oT)P)9TL{7iX$V@PAta(9$|8b7D6wp-IURZdO^p#W zhGj%3h}IwkopYY&+|PAgc}vbAem;r__Cgn?7OtN?KmKI17sC;NJ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d+}RPESw&C-Qmt z{eDiII_cIoG(6NaZ9NMru~2~FIL^=a@7>?)6>)Kk@r8yTXw@R`0mR0n1K~J*X`6K@9o%5I-T=-!?G-5 z-+trx{r=;?aR4p57Ia;=t-I@7LC+1J4>PcW*1o?POwK&B_LfyaSMwVfK3`q|$z+o5 zu5{RYqW1W>xZK;DmwX}aPNn&MeD;~=?o@8l#kkzti#=3B$V zPO%g2MIx0-acg+k@jS0ta~vl$lt>u)f-5R2XxzLRAp~XRWdIbqJ;LvVnVp>l4}Q6J zjhUI5oN+^mgt2Dr+K>iVwr%H4xUq2)pMTLoMoOggNKQWDuZia`x<4o8NKQWD(BaPz zLO~OPw!?>s_y3eLZ2R8_5>ztwW#YJ7m9--bz7zRtU`KahF0pZv$6?&}eR0zX9F z#F!f8YJ4DXUfWKgs%o{!8@?jv%j&L`d}Fy(I`^NqVd9Y-3O)_ zC>S(4I!bqECr6rUSY!I~#;q}Z9BHbdyR(zg(b0lAO*4S&x(@`9G)=Rp(n~!(+#VU> z%(hhsCC5$_IJ0dPw?{^})YDTmUzRf|bX`w0ghEA+F)1Y-$D)L4%4yy7ycMmRstMJU z({Ze{(l>-cXn!;hEl(Rs;0Oo`cvB>USX-(6L zz5B$9^)=<}-B``ujn%AQLg_V4BeHu}S_lyX<^+JEC{eSjO73iFDQO4uRDI5U*@FU5uA9p8pGi(tD~YlVQpL0000< KMNUMnLSTY-tB~dZ diff --git a/plugins/backup/images/icon.png b/plugins/backup/images/icon.png deleted file mode 100644 index 187ccb0cb010265e804121f3e01c9691e4d62eff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2419 zcmY*bc{CLI7yr&!W=O^l6+;XXdWiJ!Ng0tXamsy+kA$ zl~82OQiz^C*|PNJ{m%R6-E;1}=lebPe(yc^e$Kt$1PgPc8CNtR^ z&d!uQH%&K~iZxu%#0JhJBHZ&X^UM)q><|tB;4+Xa_2|ERVLEEs72i7-sRXH(|m-)J8AJG!DCVMB33LMsUE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"dojo/_base/declare", "dojo/_base/array", "dojo/ready", "dojo/query", "dojo/_base/fx", "dijit/registry", "dojo/parser", "dojox/widget/Standby","dojo/domReady!" ], -function(declare, array, ready, query, fx, registry, parser) { - - /** - * Base class for all plugins - */ - var klass = declare(null, { - - pluginName:"No Name", /* should be overwritten by each plugin to provide a display name */ - container: null, - standby: null, - - constructor: function(div) { - this.container = div; - }, - - init: function() { - parser.parse(this.container); - this.standby = new dojox.widget.Standby({target: this.container}); - document.body.appendChild(this.standby.domNode); - this.standby.startup(); - }, - - /** - * fade in the plugin. call this from the constructor once the plugin - * has initialized its UI. - */ - ready: function(callback) { - // console.debug("base.ready"); - var div = query(".inline-app", this.container)[0]; - var anim = fx.fadeIn({ - node: div, - duration: 200, - onEnd: function() { - if (callback) { - callback(); - } - } - }); - anim.play(); - }, - - close: function() { - this.standby.destroyRecursive(); - var widgets = registry.findWidgets(this.container); - array.forEach(widgets, function(widget) { - widget.destroyRecursive(); - }); - this.container.innerHTML = ""; - }, - - actionStart: function() { - this.standby.show(); - }, - - actionEnd: function() { - // console.debug("baseActionEnd"); - this.standby.hide(); - }, - - /** - * Dynamically load a CSS stylesheet. - */ - loadCSS: function(path) { - console.debug("loadCSS",path); - - //todo: check this code - still needed? - var head = document.getElementsByTagName("head")[0]; - query("link", head).forEach(function(elem) { - var href = elem.getAttribute("href"); - if (href === path) { - // already loaded - return; - } - }); - var link = document.createElement("link"); - link.setAttribute("rel", "stylesheet"); - link.setAttribute("type", "text/css"); - link.setAttribute("href", path); - head.appendChild(link); - } - }); - - - return klass; -}); \ No newline at end of file diff --git a/plugins/browsing/browsing.css b/plugins/browsing/browsing.css deleted file mode 100644 index 9062208b..00000000 --- a/plugins/browsing/browsing.css +++ /dev/null @@ -1,135 +0,0 @@ -#inlineApp .browsing { - margin: 0 !important; -} -.browsing { - height: 100%; -} -.browsing .browsing-container { - height: 100%; -} -.browsing .browsing-container .collection { - background: #EEE; -} -.browsing .browsing-container #breadcrumb { - height: 20px; - /* width: 100%; */ - font-size: 0.85em; - padding-left: 4pt; -} -.browsing .browsing-container #browsing-grid { - height: 300px; -} -.browsing #browsing-dialog { - width: 500px; -} -.browsing #browsing-dialog .control-group label { - float: left; - display: block; - width: 120px; - text-align: right; - margin-right: 1em; -} -.dojoxUploaderFileList { - height: 300px; - width: 100%; - overflow: auto; -} -#browsing-upload-dialog { - width: 520px; -} -#browsing-upload-dialog p { - text-align: center; - font-size: 85%; -} -#browsing-upload-dialog form.file_upload .file_upload_body { - position: relative; - overflow: hidden; - direction: ltr; - cursor: pointer; - text-align: center; - color: #555; - font-weight: bold; - -moz-border-radius: 10px; - -webkit-border-radius: 10px; - border-radius: 10px; - width: 15em; - line-height: 2.5em; - border: 3px dashed orange; - margin-left: auto; - margin-right: auto; - height: auto; -} -#browsing-upload-dialog form.file_upload .file_upload_body input { - position: absolute; - top: 0; - right: 0; - margin: 0; - border: 300px solid transparent; - opacity: 0; - -ms-filter: 'alpha(opacity=0)'; - -o-transform: translate(-300px, -300px) scale(10); - -moz-transform: translate(-800px, 0) scale(10); - cursor: pointer; - height: 100%; -} -#browsing-upload-dialog form.file_upload .file_upload_body button { - display: none; -} -#browsing-upload-dialog form.file_upload .file_upload_label { - display: block; -} -#browsing-upload-dialog form.file_upload .file_upload_body:hover { - border: 3px dashed lawngreen; -} -#browsing-upload-dialog .overall-progress { - position: relative; - width: 100%; - margin-top: 20px; -} -#browsing-upload-dialog .overall-progress .bar { - height: 18px; - background: url(/exist/apps/dashboard/plugins/browsing/images/progressbar.gif); -} -#browsing-upload-dialog .overall-progress .progress-label { - position: absolute; - left: 10px; - top: 0; -} -#browsing-upload-dialog .queue { - display: block; - width: 100%; - height: 160px; - overflow: auto; - margin: 8px 0; - font-size: 85%; -} -#browsing-upload-dialog .queue .files { - width: 100%; - margin: 0; -} -#browsing-upload-dialog .queue .files tr td { - padding: 4px 6px; - text-align: right; - border-bottom: 1px solid #E0E0E0; -} -#browsing-upload-dialog .queue .files tr td.name { - min-width: 120px; - font-weight: bold; - text-align: left; -} -#browsing-upload-dialog .queue .files tr td.progress { - width: 180px; - margin: 8px auto; -} -#browsing-upload-dialog .queue .files tr td.progress .bar { - height: 18px; - background: url(/exist/apps/dashboard/plugins/browsing/images/progressbar.gif); -} - -.labelBox { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -o-user-select: none; - user-select: none; -} diff --git a/plugins/browsing/browsing.html b/plugins/browsing/browsing.html deleted file mode 100644 index 47d8a070..00000000 --- a/plugins/browsing/browsing.html +++ /dev/null @@ -1,136 +0,0 @@ - -
-
-
-
- - - - - - - - - -
-