diff --git a/elemental-parent/pom.xml b/elemental-parent/pom.xml
index ccfd88047c..9b7686cb93 100644
--- a/elemental-parent/pom.xml
+++ b/elemental-parent/pom.xml
@@ -104,6 +104,7 @@
3.0.1
3.0.2
2.0.17
+ 9.9.1-8
1C
@@ -129,6 +130,12 @@
1.0.0
+
+ net.sf.saxon
+ Saxon-HE
+ ${saxon.version}
+
+
com.evolvedbinary.j8fu
j8fu
@@ -216,6 +223,21 @@
jaxb-maven-plugin
${jaxb.impl.version}
+
+ org.codehaus.mojo
+ xml-maven-plugin
+ 1.2.0
+
+ net.sf.saxon.TransformerFactoryImpl
+
+
+
+ net.sf.saxon
+ Saxon-HE
+ ${saxon.version}
+
+
+
org.apache.maven.plugins
maven-compiler-plugin
diff --git a/exist-ant/pom.xml b/exist-ant/pom.xml
index 565266484d..7bc52c1251 100644
--- a/exist-ant/pom.xml
+++ b/exist-ant/pom.xml
@@ -261,6 +261,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/exist-ant/src/test/resources-filtered/conf.xml b/exist-ant/src/test/resources-filtered/conf.xml
index b2f5c0b5a5..a36447f3fb 100644
--- a/exist-ant/src/test/resources-filtered/conf.xml
+++ b/exist-ant/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/exist-core/pom.xml b/exist-core/pom.xml
index 21a336b657..b7b2df7587 100644
--- a/exist-core/pom.xml
+++ b/exist-core/pom.xml
@@ -733,6 +733,7 @@
src/main/java/org/exist/util/ByteOrderMark.java
src/main/java/org/exist/util/JREUtil.java
src/main/java/org/exist/util/OSUtil.java
+ src/main/java/org/exist/util/PropertiesUtil.java
src/main/java/org/exist/util/StringUtil.java
src/main/java/org/exist/util/io/AbstractContentFile.java
src/test/java/org/exist/util/serializer/SAXSerializerTest.java
@@ -757,6 +758,7 @@
src/test/java/org/exist/xquery/functions/fn/transform/FunTransformITTest.java
src/test/java/org/exist/xquery/functions/securitymanager/AccountMetadataFunctionsTest.java
src/test/java/org/exist/xquery/functions/securitymanager/SecurityManagerTestUtil.java
+ src/main/java/org/exist/xquery/functions/system/GetElementalHome.java
src/test/java/org/exist/xquery/functions/system/GetMainModuleLoadPathTest.java
src/main/java/org/exist/xquery/functions/system/GetModuleLoadPath.java
src/test/java/org/exist/xquery/functions/system/GetModuleLoadPathTest.java
@@ -796,6 +798,7 @@
src/test/xquery/util/util.xml
src/test/xquery/xquery3/parse-xml.xqm
src/test/xquery/xquery3/serialize.xql
+ src/main/java/org/exist/BTreeTest.java
src/main/java/org/exist/Indexer.java
src/test/java/org/exist/Indexer2Test.java
src/test/java/org/exist/Indexer3Test.java
@@ -803,10 +806,13 @@
src/main/java/org/exist/Namespaces.java
src/main/resources-filtered/org/exist/system.properties
src/test/java/org/exist/TestDataGenerator.java
+ src/main/java/org/exist/TestUtils.java
src/main/java/org/exist/backup/Backup.java
+ src/main/java/org/exist/backup/BackupDirectory.java
src/main/java/org/exist/backup/CreateBackupDialog.java
src/test/java/org/exist/backup/DeepEmbeddedBackupRestoreTest.java
src/main/java/org/exist/backup/ExportGUI.java
+ src/main/java/org/exist/backup/FileSystemWriter.java
src/main/java/org/exist/backup/Main.java
src/main/java/org/exist/backup/Restore.java
src/test/java/org/exist/backup/RestoreAppsTest.java
@@ -1044,6 +1050,7 @@
src/test/java/org/exist/storage/CollectionTest.java
src/test/java/org/exist/storage/ConcurrentBrokerPoolTest.java
src/test/java/org/exist/storage/ConcurrentStoreTest.java
+ src/main/java/org/exist/storage/ConsistencyCheckTask.java
src/test/java/org/exist/storage/CopyCollectionRecoveryTest.java
src/test/java/org/exist/storage/CopyResourceRecoveryTest.java
src/test/java/org/exist/storage/CopyResourceTest.java
@@ -1121,6 +1128,7 @@
src/test/java/org/exist/util/CollationsTest.java
src/main/java/org/exist/util/CollectionScanner.java
src/main/java/org/exist/util/Configuration.java
+ src/main/java/org/exist/util/ConfigurationHelper.java
src/test/java/org/exist/util/DOMSerializerTest.java
src/main/java/org/exist/util/EXistURISchemeURIResolver.java
src/test/java/org/exist/util/LeasableTest.java
@@ -1128,6 +1136,7 @@
src/main/java/org/exist/util/MimeTable.java
src/main/java/org/exist/util/MimeType.java
src/main/java/org/exist/util/ParametersExtractor.java
+ src/main/java/org/exist/util/SingleInstanceConfiguration.java
src/main/java/org/exist/util/XMLFilenameFilter.java
src/test/java/org/exist/util/XMLReaderExpansionTest.java
src/test/java/org/exist/util/XMLReaderSecurityTest.java
@@ -1175,6 +1184,7 @@
src/main/java/org/exist/validation/resolver/SearchResourceResolver.java
src/test/java/org/exist/w3c/tests/TestCase.java
src/main/java/org/exist/webstart/JnlpJarFiles.java
+ src/main/java/org/exist/webstart/JnlpServlet.java
src/main/java/org/exist/webstart/JnlpWriter.java
src/main/java/org/exist/xmldb/AbstractEXistResource.java
src/main/java/org/exist/xmldb/AbstractRemoteResource.java
@@ -1603,6 +1613,7 @@
project-suppression.xml
src/test/resources-filtered/conf.xml
src/test/resources/log4j2.xml
+ src/test/resources-filtered/saxon-config.xml
src/test/resources/standalone-webapp/WEB-INF/web.xml
src/main/xjb/rest-api.xjb
src/test/xquery/base-uri.xql
@@ -1618,6 +1629,7 @@
src/test/xquery/xquery3/parse-xml.xqm
src/test/xquery/xquery3/postfix-expr.xqm
src/test/xquery/xquery3/serialize.xql
+ src/main/java/org/exist/BTreeTest.java
src/main/java/org/exist/Indexer.java
src/test/java/org/exist/Indexer2Test.java
src/test/java/org/exist/Indexer3Test.java
@@ -1625,10 +1637,13 @@
src/main/java/org/exist/Namespaces.java
src/main/resources-filtered/org/exist/system.properties
src/test/java/org/exist/TestDataGenerator.java
+ src/main/java/org/exist/TestUtils.java
src/main/java/org/exist/backup/Backup.java
+ src/main/java/org/exist/backup/BackupDirectory.java
src/main/java/org/exist/backup/CreateBackupDialog.java
src/test/java/org/exist/backup/DeepEmbeddedBackupRestoreTest.java
src/main/java/org/exist/backup/ExportGUI.java
+ src/main/java/org/exist/backup/FileSystemWriter.java
src/main/java/org/exist/backup/Main.java
src/main/java/org/exist/backup/Restore.java
src/test/java/org/exist/backup/RestoreAppsTest.java
@@ -1890,6 +1905,7 @@
src/test/java/org/exist/storage/CollectionTest.java
src/test/java/org/exist/storage/ConcurrentBrokerPoolTest.java
src/test/java/org/exist/storage/ConcurrentStoreTest.java
+ src/main/java/org/exist/storage/ConsistencyCheckTask.java
src/test/java/org/exist/storage/CopyCollectionRecoveryTest.java
src/test/java/org/exist/storage/CopyResourceRecoveryTest.java
src/test/java/org/exist/storage/CopyResourceTest.java
@@ -1949,6 +1965,7 @@
src/main/java/org/exist/storage/io/VariableByteOutputToOutputStream.java
src/test/java/org/exist/storage/io/VariableByteStreamTest.java
src/test/java/org/exist/storage/journal/AbstractJournalTest.java
+ src/test/java/org/exist/storage/journal/Journal.java
src/test/java/org/exist/storage/journal/JournalBinaryTest.java
src/main/java/org/exist/storage/journal/JournalManager.java
src/main/java/org/exist/storage/journal/JournalReader.java
@@ -2017,6 +2034,7 @@
src/test/java/org/exist/util/CollectionOfArrayIteratorTest.java
src/main/java/org/exist/util/CollectionScanner.java
src/main/java/org/exist/util/Configuration.java
+ src/main/java/org/exist/util/ConfigurationHelper.java
src/test/java/org/exist/util/DOMSerializerTest.java
src/main/java/org/exist/util/EXistURISchemeURIResolver.java
src/main/java/org/exist/util/IPUtil.java
@@ -2028,6 +2046,8 @@
src/main/java/org/exist/util/MimeType.java
src/main/java/org/exist/util/OSUtil.java
src/main/java/org/exist/util/ParametersExtractor.java
+ src/main/java/org/exist/util/PropertiesUtil.java
+ src/main/java/org/exist/util/SingleInstanceConfiguration.java
src/main/java/org/exist/util/StringUtil.java
src/main/java/org/exist/util/UTF8.java
src/main/java/org/exist/util/XMLFilenameFilter.java
@@ -2079,6 +2099,7 @@
src/main/java/org/exist/validation/resolver/SearchResourceResolver.java
src/test/java/org/exist/w3c/tests/TestCase.java
src/main/java/org/exist/webstart/JnlpJarFiles.java
+ src/main/java/org/exist/webstart/JnlpServlet.java
src/main/java/org/exist/webstart/JnlpWriter.java
src/main/java/org/exist/xmldb/AbstractEXistResource.java
src/main/java/org/exist/xmldb/AbstractRemoteResource.java
@@ -2410,6 +2431,7 @@
src/test/java/org/exist/xquery/functions/session/AbstractSessionTest.java
src/test/java/org/exist/xquery/functions/session/AttributeTest.java
src/main/java/org/exist/xquery/functions/system/FunctionAvailable.java
+ src/main/java/org/exist/xquery/functions/system/GetElementalHome.java
src/test/java/org/exist/xquery/functions/system/GetMainModuleLoadPathTest.java
src/main/java/org/exist/xquery/functions/system/GetModuleLoadPath.java
src/test/java/org/exist/xquery/functions/system/GetModuleLoadPathTest.java
@@ -2635,6 +2657,7 @@ The original license statement is also included below.]]>
src/main/java/org/exist/storage/blob/**
src/test/java/org/exist/storage/blob/**
src/test/java/org/exist/storage/journal/AbstractJournalTest.java
+ src/test/java/org/exist/storage/journal/Journal.java
src/test/java/org/exist/storage/journal/JournalBinaryTest.java
src/main/java/org/exist/storage/journal/JournalManager.java
src/main/java/org/exist/storage/journal/JournalReader.java
@@ -2858,6 +2881,35 @@ The BaseX Team. The original license statement is also included below.]]>
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+ org/exist/storage/statistics/conf.xml
+ org/exist/xquery/import-from-pkg-test.conf.xml
+ org/exist/xquery/JavaBindingTest.conf.xml
+ org/exist/xquery/functions/transform/transform-from-pkg-test.conf.xml
+
+
+
+
+
+
+
+
org.apache.maven.plugins
maven-surefire-plugin
@@ -2882,8 +2934,8 @@ The BaseX Team. The original license statement is also included below.]]>@{jacocoArgLine} -Dfile.encoding=${project.build.sourceEncoding} -Dexist.recovery.progressbar.hide=true
${project.basedir}/../exist-jetty-config/target/classes/org/exist/jetty
- ${project.build.testOutputDirectory}/conf.xml
- ${project.build.testOutputDirectory}/standalone-webapp
+ ${project.build.testOutputDirectory}/conf.xml
+ ${project.build.testOutputDirectory}/standalone-webapp
${project.build.testOutputDirectory}/log4j2.xml
@@ -2990,8 +3042,8 @@ The BaseX Team. The original license statement is also included below.]]>-Dfile.encoding=${project.build.sourceEncoding} -Dexist.recovery.progressbar.hide=true
${project.basedir}/../exist-jetty-config/target/classes/org/exist/jetty
- ${project.build.testOutputDirectory}/conf.xml
- ${project.build.testOutputDirectory}/standalone-webapp
+ ${project.build.testOutputDirectory}/conf.xml
+ ${project.build.testOutputDirectory}/standalone-webapp
${project.build.testOutputDirectory}/log4j2.xml
diff --git a/exist-core/src/main/java/org/exist/BTreeTest.java b/exist-core/src/main/java/org/exist/BTreeTest.java
index b8ba058726..2f1daee24a 100644
--- a/exist-core/src/main/java/org/exist/BTreeTest.java
+++ b/exist-core/src/main/java/org/exist/BTreeTest.java
@@ -1,4 +1,28 @@
/*
+ * Elemental
+ * Copyright (C) 2024, Evolved Binary Ltd
+ *
+ * admin@evolvedbinary.com
+ * https://www.evolvedbinary.com | https://www.elemental.xyz
+ *
+ * This library 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; version 2.1.
+ *
+ * This library 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * NOTE: Parts of this file contain code from 'The eXist-db Authors'.
+ * The original license header is included below.
+ *
+ * =====================================================================
+ *
* eXist-db Open Source Native XML Database
* Copyright (C) 2001 The eXist-db Authors
*
@@ -43,7 +67,7 @@ public class BTreeTest {
private BrokerPool pool = null;
public BTreeTest() {
- file = Paths.get(System.getProperty("exist.home", ".")).resolve("test/test.dbx");
+ file = Paths.get(System.getProperty("elemental.home", ".")).resolve("test/test.dbx");
try {
Configuration config = new Configuration();
diff --git a/exist-core/src/main/java/org/exist/TestUtils.java b/exist-core/src/main/java/org/exist/TestUtils.java
index 8c2cf884e7..7f951123c7 100644
--- a/exist-core/src/main/java/org/exist/TestUtils.java
+++ b/exist-core/src/main/java/org/exist/TestUtils.java
@@ -1,4 +1,28 @@
/*
+ * Elemental
+ * Copyright (C) 2024, Evolved Binary Ltd
+ *
+ * admin@evolvedbinary.com
+ * https://www.evolvedbinary.com | https://www.elemental.xyz
+ *
+ * This library 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; version 2.1.
+ *
+ * This library 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * NOTE: Parts of this file contain code from 'The eXist-db Authors'.
+ * The original license header is included below.
+ *
+ * =====================================================================
+ *
* eXist-db Open Source Native XML Database
* Copyright (C) 2001 The eXist-db Authors
*
@@ -165,17 +189,17 @@ public static byte[] readFile(final Path file) throws IOException {
}
/**
- * Get the EXIST_HOME directory
+ * Get the ELEMENTAL_HOME directory
*
- * @return The absolute path to the EXIST_HOME folder
+ * @return The absolute path to the ELEMENTAL_HOME folder
* or {@link Optional#empty()}
*/
- public static Optional getEXistHome() {
- return ConfigurationHelper.getExistHome().map(Path::toAbsolutePath);
+ public static Optional getElementalHome() {
+ return ConfigurationHelper.getElementalHome().map(Path::toAbsolutePath);
}
/**
- * Get a file from within the EXIST_HOME directory.
+ * Get a file from within the ELEMENTAL_HOME directory.
*
* @param fileName Just the name of the file.
*
@@ -183,8 +207,8 @@ public static Optional getEXistHome() {
*
* @throws IOException if an IO error occurs.
*/
- public static Optional getExistHomeFile(final String fileName) throws IOException {
- final Path path = getEXistHome().orElseGet(() -> Paths.get(".")).resolve(fileName);
+ public static Optional getElementalHomeFile(final String fileName) throws IOException {
+ final Path path = getElementalHome().orElseGet(() -> Paths.get(".")).resolve(fileName);
if(Files.exists(path)) {
return Optional.of(path);
} else {
diff --git a/exist-core/src/main/java/org/exist/backup/BackupDirectory.java b/exist-core/src/main/java/org/exist/backup/BackupDirectory.java
index a3bb3bae2c..aee9d4f87b 100644
--- a/exist-core/src/main/java/org/exist/backup/BackupDirectory.java
+++ b/exist-core/src/main/java/org/exist/backup/BackupDirectory.java
@@ -1,4 +1,28 @@
/*
+ * Elemental
+ * Copyright (C) 2024, Evolved Binary Ltd
+ *
+ * admin@evolvedbinary.com
+ * https://www.evolvedbinary.com | https://www.elemental.xyz
+ *
+ * This library 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; version 2.1.
+ *
+ * This library 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * NOTE: Parts of this file contain code from 'The eXist-db Authors'.
+ * The original license header is included below.
+ *
+ * =====================================================================
+ *
* eXist-db Open Source Native XML Database
* Copyright (C) 2001 The eXist-db Authors
*
@@ -21,10 +45,12 @@
*/
package org.exist.backup;
+import com.evolvedbinary.j8fu.tuple.Tuple2;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.exist.util.FileUtils;
+import javax.annotation.Nullable;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -32,11 +58,17 @@
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import static com.evolvedbinary.j8fu.tuple.Tuple.Tuple;
+import static org.exist.backup.BackupDescriptor.PREVIOUS_PROP_NAME;
+
public class BackupDirectory {
public final static Logger LOG = LogManager.getLogger(BackupDirectory.class);
@@ -45,25 +77,26 @@ public class BackupDirectory {
public final static String PREFIX_FULL_BACKUP_FILE = "full";
public final static String PREFIX_INC_BACKUP_FILE = "inc";
- public final static String FILE_REGEX = "(" + PREFIX_FULL_BACKUP_FILE + "|" + PREFIX_INC_BACKUP_FILE + ")(\\d{8}-\\d{4}).*";
+ public final static String FULL_FILE_REGEX = PREFIX_FULL_BACKUP_FILE + "(\\d{8}-\\d{6}).*";
+ public final static String INC_FILE_REGEX = PREFIX_INC_BACKUP_FILE + "\\d{8}-\\d{6}.*";
+ public final static String FILE_REGEX = "(?:" + PREFIX_FULL_BACKUP_FILE + "|" + PREFIX_INC_BACKUP_FILE + ")(\\d{8}-\\d{6}).*";
- public final static String DATE_FORMAT_PICTURE = "yyyyMMdd-HHmm";
- private final DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PICTURE);
+ public final static String DATE_FORMAT_PICTURE = "yyyyMMdd-HHmmss";
+ private final static DateFormat DATE_FORMAT = new SimpleDateFormat(DATE_FORMAT_PICTURE);
private final Path dir;
+ private @Nullable Matcher fileMatcher;
+ private @Nullable Matcher fullFileMatcher;
+ private @Nullable Matcher incFileMatcher;
- private final Matcher matcher;
public BackupDirectory(final String dirPath) {
this(Paths.get(dirPath));
}
-
public BackupDirectory(final Path directory) {
this.dir = directory;
- final Pattern pattern = Pattern.compile(FILE_REGEX);
- matcher = pattern.matcher("");
}
public Path createBackup(final boolean incremental, final boolean zip) {
@@ -71,7 +104,7 @@ public Path createBackup(final boolean incremental, final boolean zip) {
while (true) {
final StringBuilder buf = new StringBuilder();
buf.append(incremental ? PREFIX_INC_BACKUP_FILE : PREFIX_FULL_BACKUP_FILE);
- buf.append(dateFormat.format(new Date()));
+ buf.append(DATE_FORMAT.format(new Date()));
if (counter++ > 0) {
buf.append('_').append(counter);
@@ -98,46 +131,201 @@ public Path createBackup(final boolean incremental, final boolean zip) {
}
}
+ /**
+ * Gets the details of the last backup (if any).
+ *
+ * @return the details of the last backup, or null if there was no previous backup.
+ */
+ public @Nullable BackupDescriptor lastBackupFile() throws IOException {
+ final List files = FileUtils.list(dir);
+
+ @Nullable Path newest = null;
+ @Nullable Date newestDate = null;
- public BackupDescriptor lastBackupFile() throws IOException {
+ for (final Path file : files) {
+ @Nullable final Date date = isBackupFile(file);
+ if (date != null) {
+ if (newestDate == null || date.after(newestDate)) {
+ newestDate = date;
+ newest = file;
+ }
+ }
+ }
+
+ if (newest != null) {
+ return getBackupDescriptor(newest);
+ }
+
+ return null;
+ }
+
+ /**
+ * If the provided file is a full or incremental backup
+ * then the Date of the backup is returned.
+ *
+ * @param file the file to test if it is a backup.
+ *
+ * @return the date of the backup, or null if the file is not a backup.
+ */
+ private @Nullable Date isBackupFile(final Path file) {
+ final String fileName = FileUtils.fileName(file);
+ if (fileMatcher == null) {
+ final Pattern filePattern = Pattern.compile(FILE_REGEX);
+ this.fileMatcher = filePattern.matcher(fileName);
+ } else {
+ this.fileMatcher.reset(fileName);
+ }
+
+ if (this.fileMatcher.matches()) {
+ final String dateTime = fileMatcher.group(1);
+ try {
+ return DATE_FORMAT.parse(dateTime);
+ } catch (final ParseException e) {
+ // no-op
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the number of full backups present in the directory.
+ *
+ * @return the number of full backups present in the directory.
+ */
+ public int countFullBackups() throws IOException {
final List files = FileUtils.list(dir);
- Path newest = null;
- Date newestDate = null;
+ int count = 0;
for (final Path file : files) {
- matcher.reset(FileUtils.fileName(file));
+ @Nullable final Date date = isFullBackupFile(file);
+ if (date != null) {
+ count++;
+ }
+ }
- if (matcher.matches()) {
- final String dateTime = matcher.group(2);
+ return count;
+ }
- try {
- final Date date = dateFormat.parse(dateTime);
+ /**
+ * If the provided file is a full backup
+ * then the Date of the backup is returned.
+ *
+ * @param file the file to test if it is a full backup.
+ *
+ * @return the date of the full backup, or null if the file is not a full backup.
+ */
+ private @Nullable Date isFullBackupFile(final Path file) {
+ final String fileName = FileUtils.fileName(file);
+ if (fullFileMatcher == null) {
+ final Pattern fullFilePattern = Pattern.compile(FULL_FILE_REGEX);
+ this.fullFileMatcher = fullFilePattern.matcher(fileName);
+ } else {
+ this.fullFileMatcher.reset(fileName);
+ }
- if ((newestDate == null) || date.after(newestDate)) {
- newestDate = date;
- newest = file;
+ if (this.fullFileMatcher.matches()) {
+ final String dateTime = fullFileMatcher.group(1);
+ try {
+ return DATE_FORMAT.parse(dateTime);
+ } catch (final ParseException e) {
+ // no-op
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Gets the oldest full-backup and any associated incremental backups (if any).
+ *
+ * @return the path of the oldest backup, and any associated incremental backups, or null if there was no previous full backup.
+ */
+ public @Nullable List getOldestFullBackup() throws IOException {
+ final List files = FileUtils.list(dir);
+
+ @Nullable Path oldestFullBackup = null;
+ @Nullable Date oldestFullBackupDate = null;
+
+ // find the oldest full backup, and create a map of incremental backups
+ @Nullable Map> previousToIncremental = null;
+ for (final Path file : files) {
+ @Nullable final Date date = isFullBackupFile(file);
+ if (date != null) {
+ if (oldestFullBackupDate == null || date.before(oldestFullBackupDate)) {
+ oldestFullBackupDate = date;
+ oldestFullBackup = file;
+ }
+ } else {
+ @Nullable BackupDescriptor incBackupDescriptor = isIncBackupFile(file);
+ if (incBackupDescriptor != null) {
+ @Nullable String previousBackup = incBackupDescriptor.getProperties().getProperty(PREVIOUS_PROP_NAME);
+ if (previousBackup != null) {
+ if (previousToIncremental == null) {
+ previousToIncremental = new HashMap<>();
+ }
+ previousToIncremental.put(previousBackup, Tuple(incBackupDescriptor.getName(), file));
}
- } catch (final ParseException e) {
}
}
}
- BackupDescriptor descriptor = null;
- if (newest != null) {
+ @Nullable List oldestBackups = null;
+ if (oldestFullBackup != null) {
+ oldestBackups = new ArrayList<>();
+ oldestBackups.add(oldestFullBackup);
- try {
-
- if (FileUtils.fileName(newest).toLowerCase().endsWith(".zip")) {
- descriptor = new ZipArchiveBackupDescriptor(newest);
- } else {
- descriptor = new FileSystemBackupDescriptor(newest, newest.resolve("db").resolve(BackupDescriptor.COLLECTION_DESCRIPTOR));
+ // Find any associated incremental backups
+ if (previousToIncremental != null) {
+ final BackupDescriptor oldestFullBackupDescriptor = getBackupDescriptor(oldestFullBackup);
+ @Nullable Tuple2 incrementalBackupInfo = previousToIncremental.get(oldestFullBackupDescriptor.getName());
+ while (incrementalBackupInfo != null) {
+ oldestBackups.add(incrementalBackupInfo._2);
+ incrementalBackupInfo = previousToIncremental.get(incrementalBackupInfo._1);
}
- } catch (final IOException e) {
- e.printStackTrace();
}
}
- return (descriptor);
+
+ return oldestBackups;
+ }
+
+ /**
+ * If the provided file is an incremental backup
+ * then the Date of the backup is returned.
+ *
+ * @param file the file to test if it is an incremental backup.
+ *
+ * @return the date of the incremental backup, or null if the file is not an incremental backup.
+ */
+ private @Nullable BackupDescriptor isIncBackupFile(final Path file) {
+ final String fileName = FileUtils.fileName(file);
+ if (incFileMatcher == null) {
+ final Pattern incFilePattern = Pattern.compile(INC_FILE_REGEX);
+ this.incFileMatcher = incFilePattern.matcher(fileName);
+ } else {
+ this.incFileMatcher.reset(fileName);
+ }
+
+ if (this.incFileMatcher.matches()) {
+ return getBackupDescriptor(file);
+ }
+
+ return null;
+ }
+
+ private @Nullable BackupDescriptor getBackupDescriptor(final Path path) {
+ try {
+ if (FileUtils.fileName(path).toLowerCase().endsWith(".zip")) {
+ return new ZipArchiveBackupDescriptor(path);
+ } else {
+ return new FileSystemBackupDescriptor(path, path.resolve("db").resolve(BackupDescriptor.COLLECTION_DESCRIPTOR));
+ }
+ } catch (final IOException e) {
+ LOG.error(e.getMessage(), e);
+ }
+
+ return null;
}
}
diff --git a/exist-core/src/main/java/org/exist/backup/ExportGUI.java b/exist-core/src/main/java/org/exist/backup/ExportGUI.java
index d1f0815ba0..532e2449d8 100644
--- a/exist-core/src/main/java/org/exist/backup/ExportGUI.java
+++ b/exist-core/src/main/java/org/exist/backup/ExportGUI.java
@@ -115,10 +115,10 @@ public class ExportGUI extends javax.swing.JFrame {
public ExportGUI() {
super("Consistency Check and Repair");
initComponents();
- final String existHome = System.getProperty("exist.home", "./");
+ final String existHome = System.getProperty("elemental.home", System.getProperty("exist.home", "./"));
final Path home = Paths.get(existHome).normalize();
dbConfig.setText(
- Optional.ofNullable(System.getProperty("exist.configurationFile")).map(Paths::get)
+ Optional.ofNullable(System.getProperty("elemental.configurationFile", System.getProperty("exist.configurationFile"))).map(Paths::get)
.orElse(home.resolve("etc").resolve("conf.xml"))
.toAbsolutePath().toString());
outputDir.setText(home.resolve("export").toAbsolutePath().toString());
@@ -423,7 +423,7 @@ private void btnConfSelectActionPerformed(final java.awt.event.ActionEvent evt)
final JFileChooser chooser = new JFileChooser();
chooser.setMultiSelectionEnabled(false);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
- chooser.setSelectedFile(Optional.ofNullable(System.getProperty("exist.configurationFile"))
+ chooser.setSelectedFile(Optional.ofNullable(System.getProperty("elemental.configurationFile", System.getProperty("exist.configurationFile")))
.map(Paths::get)
.orElse(dir.resolve("etc").resolve("conf.xml"))
.toFile());
diff --git a/exist-core/src/main/java/org/exist/backup/FileSystemWriter.java b/exist-core/src/main/java/org/exist/backup/FileSystemWriter.java
index 04971405ed..1ef5184b3c 100644
--- a/exist-core/src/main/java/org/exist/backup/FileSystemWriter.java
+++ b/exist-core/src/main/java/org/exist/backup/FileSystemWriter.java
@@ -1,4 +1,28 @@
/*
+ * Elemental
+ * Copyright (C) 2024, Evolved Binary Ltd
+ *
+ * admin@evolvedbinary.com
+ * https://www.evolvedbinary.com | https://www.elemental.xyz
+ *
+ * This library 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; version 2.1.
+ *
+ * This library 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * NOTE: Parts of this file contain code from 'The eXist-db Authors'.
+ * The original license header is included below.
+ *
+ * =====================================================================
+ *
* eXist-db Open Source Native XML Database
* Copyright (C) 2001 The eXist-db Authors
*
@@ -35,6 +59,8 @@
import java.nio.file.StandardCopyOption;
import java.util.Properties;
+import static org.exist.backup.BackupDescriptor.BACKUP_PROPERTIES;
+
/**
* Implementation of BackupWriter that writes to the file system.
@@ -129,7 +155,7 @@ public void setProperties(final Properties properties) throws IOException {
if (dataWritten) {
throw (new IOException("Backup properties need to be set before any backup data is written"));
}
- final Path propFile = rootDir.resolve("backup.properties");
+ final Path propFile = rootDir.resolve(BACKUP_PROPERTIES);
try (final OutputStream os = new BufferedOutputStream(Files.newOutputStream(propFile))) {
properties.store(os, "Backup properties");
}
diff --git a/exist-core/src/main/java/org/exist/backup/Main.java b/exist-core/src/main/java/org/exist/backup/Main.java
index bb1dbe4665..7af936ec0f 100644
--- a/exist-core/src/main/java/org/exist/backup/Main.java
+++ b/exist-core/src/main/java/org/exist/backup/Main.java
@@ -73,6 +73,7 @@
import java.util.concurrent.*;
import java.util.prefs.Preferences;
+import static org.exist.backup.BackupDescriptor.BACKUP_PROPERTIES;
import static org.exist.util.ArgumentUtil.getBool;
import static org.exist.util.ArgumentUtil.getOpt;
import static se.softhouse.jargo.Arguments.*;
@@ -161,15 +162,15 @@ public class Main {
private static Properties loadProperties() {
try {
- final Properties properties = ConfigurationHelper.loadProperties("backup.properties", Main.class);
+ final Properties properties = ConfigurationHelper.loadProperties(BACKUP_PROPERTIES, Main.class);
if (properties != null) {
return properties;
}
- System.err.println("WARN - Unable to find backup.properties");
+ System.err.println("WARN - Unable to find " + BACKUP_PROPERTIES);
} catch (final IOException e) {
- System.err.println("WARN - Unable to load backup.properties: " + e.getMessage());
+ System.err.println("WARN - Unable to load " + BACKUP_PROPERTIES + ": " + e.getMessage());
}
// return new empty properties
@@ -226,7 +227,7 @@ public static void process(final ParsedArguments arguments) {
}
// load MediaTypeResolver
- final Optional existHome = ConfigurationHelper.getExistHome();
+ final Optional existHome = ConfigurationHelper.getElementalHome();
@Nullable final Path applicationConfigDir = existHome.map(p -> p.resolve("etc")).filter(Files::exists).orElse(null);
@Nullable final MediaTypeResolver mediaTypeResolver = MediaTypeUtil.newMediaTypeResolver(applicationConfigDir);
diff --git a/exist-core/src/main/java/org/exist/backup/SystemExport.java b/exist-core/src/main/java/org/exist/backup/SystemExport.java
index c7d6c84c4a..910454faa1 100644
--- a/exist-core/src/main/java/org/exist/backup/SystemExport.java
+++ b/exist-core/src/main/java/org/exist/backup/SystemExport.java
@@ -95,6 +95,7 @@
import org.xml.sax.helpers.NamespaceSupport;
import xyz.elemental.mediatype.MediaType;
+import javax.annotation.Nullable;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.OutputKeys;
@@ -106,6 +107,7 @@
import java.util.*;
import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.exist.util.PropertiesUtil.getIntegerProperty;
/**
@@ -181,31 +183,32 @@ public SystemExport(final DBBroker broker, final Txn transaction, final StatusCa
}
public Path export(final String targetDir, final boolean incremental, final boolean zip, final List errorList) {
- return (export(targetDir, incremental, -1, zip, errorList));
+ return (export(targetDir, incremental, -1, -1, zip, errorList));
}
-
/**
- * Export the contents of the database, trying to preserve as much data as possible. To be effective, this method should be used in combination
- * with class {@link ConsistencyCheck}.
+ * Export the contents of the database, trying to preserve as much data as possible.
+ * To be effective, this method should be used in combination with {@link ConsistencyCheck}.
+ *
+ * @param outputPath the output directory where the backup will be written.
+ * @param incremental true if an incremental backup should be attempted, otherwise a full backup is performed.
+ * @param incrementalMax the maximum number of incremental backups allowed between each full backup, ignored if a full backup is requested.
+ * @param fullMax The maximum number of full backups to keep on disk before creating a new backup erases the oldest backup.
+ * Set to -1 to create unlimited full backups. If a full backup is removed, any incremental backups for that full backup will also be removed.
+ * @param zip true to write the backup to a zip file, otherwise false to write the backup to a folder.
+ * @param errorList a list to capture {@link ErrorReport} objects as returned by methods in {@link ConsistencyCheck}.
*
- * @param targetDir the output directory or file to which data will be written. Output will be written to a zip file if target ends with
- * .zip.
- * @param incremental DOCUMENT ME!
- * @param maxInc DOCUMENT ME!
- * @param zip DOCUMENT ME!
- * @param errorList a list of {@link ErrorReport} objects as returned by methods in {@link ConsistencyCheck}.
- * @return DOCUMENT ME!
+ * @return the path to the new backup file or folder.
*/
- public Path export(final String targetDir, boolean incremental, final int maxInc, final boolean zip, final List errorList) {
+ public Path export(final String outputPath, boolean incremental, final int incrementalMax, final int fullMax, final boolean zip, final List errorList) {
Path backupFile = null;
try {
- final BackupDirectory directory = new BackupDirectory(targetDir);
+ final BackupDirectory backupDirectory = new BackupDirectory(outputPath);
BackupDescriptor prevBackup = null;
if (incremental) {
- prevBackup = directory.lastBackupFile();
+ prevBackup = backupDirectory.lastBackupFile();
LOG.info("Creating incremental backup. Prev backup: {}", (prevBackup == null) ? "none" : prevBackup.getSymbolicPath());
}
@@ -219,12 +222,10 @@ public Path export(final String targetDir, boolean incremental, final int maxInc
final Properties prevProp = prevBackup.getProperties();
if (prevProp != null) {
- final String seqNrStr = prevProp.getProperty(BackupDescriptor.NUMBER_IN_SEQUENCE_PROP_NAME, "1");
-
try {
- seqNr = Integer.parseInt(seqNrStr);
+ seqNr = getIntegerProperty(prevProp, BackupDescriptor.NUMBER_IN_SEQUENCE_PROP_NAME, 1);
- if (seqNr == maxInc) {
+ if (seqNr > incrementalMax) {
seqNr = 1;
incremental = false;
prevBackup = null;
@@ -245,7 +246,7 @@ public Path export(final String targetDir, boolean incremental, final int maxInc
} catch (final XPathException e) {
}
- backupFile = directory.createBackup(incremental && (prevBackup != null), zip);
+ backupFile = backupDirectory.createBackup(incremental && (prevBackup != null), zip);
final FunctionE fWriter;
if (zip) {
@@ -268,6 +269,20 @@ public Path export(final String targetDir, boolean incremental, final int maxInc
exportOrphans(output, cb.getDocs(), errorList);
}
+ try {
+ if (fullMax != -1 && backupDirectory.countFullBackups() > fullMax) {
+ // There now more full backups than allowed, so delete the oldest full backup and any associated incremental backups
+ @Nullable final List oldestFullBackupFiles = backupDirectory.getOldestFullBackup();
+ if (oldestFullBackupFiles != null) {
+ for (final Path oldestFullBackupFile : oldestFullBackupFiles) {
+ FileUtils.deleteQuietly(oldestFullBackupFile);
+ }
+ }
+ }
+ } catch (final IOException e) {
+ LOG.error("Unable to remove oldest backup: " + e.getMessage(), e);
+ }
+
return backupFile;
} catch (final IOException e) {
diff --git a/exist-core/src/main/java/org/exist/backup/ZipWriter.java b/exist-core/src/main/java/org/exist/backup/ZipWriter.java
index dee39fa485..c27da508f5 100644
--- a/exist-core/src/main/java/org/exist/backup/ZipWriter.java
+++ b/exist-core/src/main/java/org/exist/backup/ZipWriter.java
@@ -56,6 +56,8 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
+import static org.exist.backup.BackupDescriptor.BACKUP_PROPERTIES;
+
/**
* Implementation of BackupWriter that writes to a zip file.
@@ -152,7 +154,7 @@ public void setProperties(final Properties properties ) throws IOException
if( dataWritten ) {
throw( new IOException( "Backup properties need to be set before any backup data is written" ) );
}
- final ZipEntry entry = new ZipEntry( "backup.properties" );
+ final ZipEntry entry = new ZipEntry(BACKUP_PROPERTIES);
out.putNextEntry( entry );
try {
properties.store(out, "Backup properties");
diff --git a/exist-core/src/main/java/org/exist/client/InteractiveClient.java b/exist-core/src/main/java/org/exist/client/InteractiveClient.java
index 4fc917bfe7..149b033709 100644
--- a/exist-core/src/main/java/org/exist/client/InteractiveClient.java
+++ b/exist-core/src/main/java/org/exist/client/InteractiveClient.java
@@ -2244,7 +2244,7 @@ public boolean run() throws Exception {
this.path = options.setCol.orElse(XmldbURI.ROOT_COLLECTION_URI);
// get Elemental home
- final Optional home = ConfigurationHelper.getExistHome();
+ final Optional home = ConfigurationHelper.getElementalHome();
// get default configuration filename from the driver class and set it in properties
Optional configFile = ConfigurationHelper.getFromSystemProperty();
diff --git a/exist-core/src/main/java/org/exist/config/Configuration.java b/exist-core/src/main/java/org/exist/config/Configuration.java
index e49ec56b6b..0e134490db 100644
--- a/exist-core/src/main/java/org/exist/config/Configuration.java
+++ b/exist-core/src/main/java/org/exist/config/Configuration.java
@@ -54,6 +54,8 @@
import org.exist.storage.DBBroker;
import org.w3c.dom.Element;
+import javax.annotation.Nullable;
+
/**
* Configuration interface provide methods to read settings.
*
@@ -101,7 +103,7 @@ public interface Configuration {
* @param property to get the value for
* @return String value of the requested property
*/
- String getProperty(String property);
+ @Nullable String getProperty(String property);
/**
* Return property map value.
@@ -118,7 +120,7 @@ public interface Configuration {
* @return property integer value
*
*/
- Integer getPropertyInteger(String property);
+ @Nullable Integer getPropertyInteger(String property);
/**
* Return property long value.
@@ -127,7 +129,7 @@ public interface Configuration {
* @return property long value
*
*/
- Long getPropertyLong(String property);
+ @Nullable Long getPropertyLong(String property);
/**
* Return property boolean value.
@@ -136,7 +138,7 @@ public interface Configuration {
* @return property boolean value
*
*/
- Boolean getPropertyBoolean(String property);
+ @Nullable Boolean getPropertyBoolean(String property);
/**
* Keep at internal map object associated with key.
diff --git a/exist-core/src/main/java/org/exist/config/ConfigurationImpl.java b/exist-core/src/main/java/org/exist/config/ConfigurationImpl.java
index 6471b73118..9d73fdf711 100644
--- a/exist-core/src/main/java/org/exist/config/ConfigurationImpl.java
+++ b/exist-core/src/main/java/org/exist/config/ConfigurationImpl.java
@@ -56,8 +56,13 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import javax.annotation.Nullable;
import javax.xml.XMLConstants;
+import static org.exist.util.PropertiesUtil.getBooleanOrYesNoProperty;
+import static org.exist.util.PropertiesUtil.getIntegerProperty;
+import static org.exist.util.PropertiesUtil.getLongProperty;
+
/**
* configuration -> element
* property -> attribute
@@ -185,7 +190,7 @@ public void clearCache() {
}
@Override
- public String getProperty(String name) {
+ public @Nullable String getProperty(final String name) {
cache();
@@ -200,10 +205,11 @@ public String getProperty(String name) {
// return null;
}
- public String getProperty(String name, String default_property) {
- final String property = getProperty(name);
-
- if (property == null) return default_property;
+ public String getProperty(final String name, final String defaultProperty) {
+ @Nullable final String property = getProperty(name);
+ if (property == null) {
+ return defaultProperty;
+ }
return property;
}
@@ -280,7 +286,7 @@ public Map getPropertyMap(String name) {
}
@Override
- public boolean hasProperty(String name) {
+ public boolean hasProperty(final String name) {
cache();
return props.containsKey(name);
@@ -290,85 +296,34 @@ public boolean hasProperty(String name) {
// return (getElementsByTagName(name).getLength() == 1);
}
- public Object getRuntimeProperty(String name) {
+ public Object getRuntimeProperty(final String name) {
return runtimeProperties.get(name);
}
- public boolean hasRuntimeProperty(String name) {
+ public boolean hasRuntimeProperty(final String name) {
return runtimeProperties.containsKey(name);
}
- public void setRuntimeProperty(String name, Object obj) {
+ public void setRuntimeProperty(final String name, final Object obj) {
runtimeProperties.put(name, obj);
}
@Override
- public Boolean getPropertyBoolean(final String name) {
- final String value = getProperty(name);
- if(value == null) {
- return null;
- }
- switch(value.toLowerCase()) {
- case "yes":
- case "true":
- return true;
-
- case "no":
- case "false":
- return false;
-
- default:
- return null;
- }
- }
-
- public Boolean getPropertyBoolean(String name, boolean defaultValue) {
- Boolean value = getPropertyBoolean(name);
- if(value == null) return defaultValue;
-
- return value;
+ public @Nullable Boolean getPropertyBoolean(final String name) {
+ cache();
+ return getBooleanOrYesNoProperty(props, name);
}
@Override
- public Integer getPropertyInteger(final String name) {
- final String value = getProperty(name);
- if (value == null) {
- return null;
- }
- return Integer.valueOf(value);
- }
-
- public Integer getPropertyInteger(final String name, final Integer defaultValue, final boolean positive) {
- final String value = getProperty(name);
- if (value == null) {
- return defaultValue;
- }
- final int result = Integer.parseInt(value);
- if ((positive) && (result < 0)) {
- return defaultValue;
- }
- return result;
+ public @Nullable Integer getPropertyInteger(final String name) {
+ cache();
+ return getIntegerProperty(props, name);
}
@Override
- public Long getPropertyLong(final String name) {
- final String value = getProperty(name);
- if (value == null) {
- return null;
- }
- return Long.valueOf(value);
- }
-
- public Long getPropertyLong(final String name, final Long defaultValue, final boolean positive) {
- final String value = getProperty(name);
- if (value == null) {
- return defaultValue;
- }
- final long result = Long.parseLong(value);
- if ((positive) && (result < 0)) {
- return defaultValue;
- }
- return result;
+ public @Nullable Long getPropertyLong(final String name) {
+ cache();
+ return getLongProperty(props, name);
}
public Integer getPropertyMegabytes(String name, Integer defaultValue) {
diff --git a/exist-core/src/main/java/org/exist/http/Descriptor.java b/exist-core/src/main/java/org/exist/http/Descriptor.java
index 255e605de4..43674c52de 100644
--- a/exist-core/src/main/java/org/exist/http/Descriptor.java
+++ b/exist-core/src/main/java/org/exist/http/Descriptor.java
@@ -51,7 +51,6 @@
import org.exist.dom.memtree.SAXAdapter;
import org.exist.util.ConfigurationHelper;
import org.exist.util.ExistSAXParserFactory;
-import org.exist.util.SingleInstanceConfiguration;
import org.exist.xquery.Expression;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -104,6 +103,7 @@ public class Descriptor implements ErrorHandler {
private boolean requestsFiltered;
private String allowSourceList[] = null; //Array of xql files to allow source to be viewed
private String mapList[][] = null; //Array of Mappings
+ private String webappDir;
/**
* Descriptor Constructor.
@@ -141,6 +141,8 @@ private Descriptor() {
}
}
+ this.webappDir = ConfigurationHelper.getElementalHome().map(elementalHome -> elementalHome.resolve("etc")).map(etc -> etc.resolve("webapp")).orElseGet(() -> Paths.get(".")).normalize().toAbsolutePath().toString().replace('\\', '/');
+
// initialize xml parser
// we use eXist's in-memory DOM implementation to work
// around a bug in Xerces
@@ -234,8 +236,8 @@ private void configureAllowSourceXQuery(Element allowsourcexqueries) {
LOG.warn("Error element 'xquery' requires an attribute 'path'");
return;
}
- path = path.replaceAll("\\$\\{WEBAPP_HOME\\}",
- SingleInstanceConfiguration.getWebappHome().orElse(Paths.get(".")).toAbsolutePath().toString().replace('\\', '/'));
+
+ path = path.replaceAll("\\$\\{WEBAPP_HOME\\}", webappDir);
//store the path
allowSourceList[i] = path;
@@ -270,16 +272,14 @@ private void configureMaps(Element maps) {
LOG.warn("Error element 'map' requires an attribute 'path' or an attribute 'pattern'");
return;
}
- path = path.replaceAll("\\$\\{WEBAPP_HOME\\}",
- SingleInstanceConfiguration.getWebappHome().orElse(Paths.get(".")).toAbsolutePath().toString().replace('\\', '/'));
+ path = path.replaceAll("\\$\\{WEBAPP_HOME\\}", webappDir);
//must be a view to map to
if (view.isEmpty()) {
LOG.warn("Error element 'map' requires an attribute 'view'");
return;
}
- view = view.replaceAll("\\$\\{WEBAPP_HOME\\}",
- SingleInstanceConfiguration.getWebappHome().orElse(Paths.get(".")).toAbsolutePath().toString().replace('\\', '/'));
+ view = view.replaceAll("\\$\\{WEBAPP_HOME\\}", webappDir);
//store what to map from
/* if(path != null)
diff --git a/exist-core/src/main/java/org/exist/http/servlets/AbstractExistHttpServlet.java b/exist-core/src/main/java/org/exist/http/servlets/AbstractExistHttpServlet.java
index b692b60606..b0ecea08f8 100644
--- a/exist-core/src/main/java/org/exist/http/servlets/AbstractExistHttpServlet.java
+++ b/exist-core/src/main/java/org/exist/http/servlets/AbstractExistHttpServlet.java
@@ -141,7 +141,7 @@ private BrokerPool getOrCreateBrokerPool(final ServletConfig config) throws EXis
)
.orElse(Optional.ofNullable(config.getServletContext().getRealPath("/")).map(Paths::get));
- getLog().info("EXistServlet: exist.home={}", dbHome.map(Path::toString).orElse("null"));
+ getLog().info("EXistServlet: elemental.home={}", dbHome.map(Path::toString).orElse("null"));
final Path cf = dbHome.map(h -> h.resolve(confFile)).orElse(Paths.get(confFile));
getLog().info("Reading configuration from {}", cf.toAbsolutePath().toString());
diff --git a/exist-core/src/main/java/org/exist/jetty/JettyStart.java b/exist-core/src/main/java/org/exist/jetty/JettyStart.java
index 0a2604499a..bc3086c7ee 100644
--- a/exist-core/src/main/java/org/exist/jetty/JettyStart.java
+++ b/exist-core/src/main/java/org/exist/jetty/JettyStart.java
@@ -69,7 +69,6 @@
import org.exist.util.ConfigurationHelper;
import org.exist.util.FileUtils;
import org.exist.util.OSUtil;
-import org.exist.util.SingleInstanceConfiguration;
import org.exist.util.SystemExitCodes;
import org.exist.validation.XmlLibraryChecker;
import org.exist.xmldb.DatabaseImpl;
@@ -191,7 +190,7 @@ public synchronized void run() {
public synchronized void run(final boolean standalone) {
final String jettyHome = Optional.ofNullable(System.getProperty(JETTY_HOME_PROP))
.orElseGet(() -> {
- final Optional home = ConfigurationHelper.getExistHome();
+ final Optional home = ConfigurationHelper.getElementalHome();
final Path toolsJetty = FileUtils.resolve(home, "tools").resolve("jetty");
final String jettyPath = toolsJetty.toAbsolutePath().toString();
System.setProperty(JETTY_HOME_PROP, jettyPath);
@@ -275,16 +274,17 @@ public synchronized void run(final String[] args, final Observer observer) {
logger.info("[Elemental Build: {}]", SystemProperties.getInstance().getSystemProperty("product-build", "unknown"));
logger.info("[Elemental Git commit: {}]", SystemProperties.getInstance().getSystemProperty("git-commit", "unknown"));
logger.info("[Elemental Git commit timestamp: {}]", SystemProperties.getInstance().getSystemProperty("git-commit-timestamp", "unknown"));
- logger.info("[Elemental Home: {}]", System.getProperty("exist.home", "unknown"));
+ logger.info("[Elemental Home: {}]", System.getProperty("elemental.home", System.getProperty("exist.home", "unknown")));
// configure the database instance
- SingleInstanceConfiguration config;
+ final String configFilename;
if (args.length == 2) {
- config = new SingleInstanceConfiguration(args[1]);
+ configFilename = args[1];
} else {
- config = new SingleInstanceConfiguration();
+ configFilename = "conf.xml";
}
- final String elementalConfigPath = config.getConfigFilePath()
+ final Configuration configuration = new Configuration(configFilename);
+ final String elementalConfigPath = configuration.getConfigFilePath()
.map(Path::normalize).map(Path::toAbsolutePath).map(Path::toString)
.orElse("");
logger.info("[Elemental Configuration: {}]", elementalConfigPath);
@@ -301,7 +301,7 @@ public synchronized void run(final String[] args, final Observer observer) {
final Object additionalElementalConfigPropertyValue = additionalElementalConfigProperty.getValue();
if (AUTODEPLOY_PROPERTY.equals(additionalElementalConfigPropertyKey) && "off".equals(additionalElementalConfigPropertyValue)) {
// remove auto deploy from config if present
- final List configuredStartupTriggers = (List) config.getProperty(BrokerPoolConstants.PROPERTY_STARTUP_TRIGGERS);
+ final List configuredStartupTriggers = (List) configuration.getProperty(BrokerPoolConstants.PROPERTY_STARTUP_TRIGGERS);
for (final Configuration.StartupTriggerConfig configuredStartupTrigger : configuredStartupTriggers) {
if (AutoDeploymentTrigger.class.getName().equals(configuredStartupTrigger.getClazz())) {
configuredStartupTriggers.remove(configuredStartupTrigger);
@@ -310,11 +310,11 @@ public synchronized void run(final String[] args, final Observer observer) {
}
} else {
- config.setProperty(additionalElementalConfigPropertyKey.toString(), additionalElementalConfigPropertyValue);
+ configuration.setProperty(additionalElementalConfigPropertyKey.toString(), additionalElementalConfigPropertyValue);
}
}
- BrokerPool.configure(1, 5, config, Optional.ofNullable(observer));
+ BrokerPool.configure(1, 5, configuration, Optional.ofNullable(observer));
// register the XMLDB driver
final Database xmldb = new DatabaseImpl();
diff --git a/exist-core/src/main/java/org/exist/launcher/ConfigurationDialog.java b/exist-core/src/main/java/org/exist/launcher/ConfigurationDialog.java
index 07d7cf205b..324cbb741c 100644
--- a/exist-core/src/main/java/org/exist/launcher/ConfigurationDialog.java
+++ b/exist-core/src/main/java/org/exist/launcher/ConfigurationDialog.java
@@ -622,7 +622,7 @@ private void btnSelectDirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
final Optional currentDir = Optional.ofNullable(dataDir.getText())
.map(d -> Optional.of(Paths.get(d)))
.filter(md -> md.map(Files::exists).orElse(false))
- .orElse(ConfigurationHelper.getExistHome());
+ .orElse(ConfigurationHelper.getElementalHome());
final JFileChooser chooser = new JFileChooser();
chooser.setMultiSelectionEnabled(false);
diff --git a/exist-core/src/main/java/org/exist/launcher/ConfigurationUtility.java b/exist-core/src/main/java/org/exist/launcher/ConfigurationUtility.java
index 45b6fc0175..5f22d9965a 100644
--- a/exist-core/src/main/java/org/exist/launcher/ConfigurationUtility.java
+++ b/exist-core/src/main/java/org/exist/launcher/ConfigurationUtility.java
@@ -78,8 +78,8 @@ public class ConfigurationUtility {
/**
* We try to resolve any config file relative to an Elemental
- * config file indicated by the System Property {@link org.exist.util.ConfigurationHelper#PROP_EXIST_CONFIGURATION_FILE},
- * if such a file does not exist, then we try and resolve it from the user.home or EXIST_HOME.
+ * config file indicated by the System Property {@link org.exist.util.ConfigurationHelper#PROP_ELEMENTAL_CONFIGURATION_FILE},
+ * if such a file does not exist, then we try and resolve it from the user.home or ELEMENTAL_HOME.
*
* @param configFileName the name/relative path of the config file to lookup
* @param shouldExist if the file should already exist
@@ -89,7 +89,7 @@ public class ConfigurationUtility {
public static Path lookup(final String configFileName, final boolean shouldExist) {
return org.exist.util.ConfigurationHelper.getFromSystemProperty()
.filter(Files::exists)
- .map(existConfigFile -> existConfigFile.resolveSibling(configFileName))
+ .map(elementalConfigFile -> elementalConfigFile.resolveSibling(configFileName))
.filter(f -> !shouldExist || Files.exists(f))
.orElseGet(() -> org.exist.util.ConfigurationHelper.lookup(configFileName));
}
diff --git a/exist-core/src/main/java/org/exist/launcher/Launcher.java b/exist-core/src/main/java/org/exist/launcher/Launcher.java
index 6587c8d414..38323eda0e 100644
--- a/exist-core/src/main/java/org/exist/launcher/Launcher.java
+++ b/exist-core/src/main/java/org/exist/launcher/Launcher.java
@@ -45,6 +45,7 @@
*/
package org.exist.launcher;
+import com.evolvedbinary.j8fu.OptionalUtil;
import org.exist.EXistException;
import org.exist.jetty.JettyStart;
import org.exist.repo.ExistRepository;
@@ -160,10 +161,10 @@ public static void main(final String[] args) {
captureConsole();
- // try and figure out exist home dir
- final Optional existHomeDir = getFromSysPropOrEnv(Main.PROP_EXIST_HOME, Main.ENV_EXIST_HOME).map(Paths::get);
+ // try and figure out elemental home dir
+ final Optional elementalHomeDir = OptionalUtil.or(getFromSysPropOrEnv(Main.PROP_ELEMENTAL_HOME, Main.ENV_ELEMENTAL_HOME), () -> getFromSysPropOrEnv(Main.LEGACY_PROP_EXIST_HOME, Main.LEGACY_ENV_EXIST_HOME)).map(Paths::get);
- this.jettyConfig = getJettyConfig(existHomeDir);
+ this.jettyConfig = getJettyConfig(elementalHomeDir);
this.serviceManager = ServiceManagerFactory.getServiceManager();
@@ -757,9 +758,9 @@ public void update(final Observable observable, final Object o) {
}
}
- private Path getJettyConfig(final Optional existHomeDir) {
+ private Path getJettyConfig(final Optional elementalHomeDir) {
- Optional existJettyConfigFile = getFromSysPropOrEnv(Main.PROP_EXIST_JETTY_CONFIG, Main.ENV_EXIST_JETTY_CONFIG).map(Paths::get);
+ Optional existJettyConfigFile = OptionalUtil.or(getFromSysPropOrEnv(Main.PROP_ELEMENTAL_JETTY_CONFIG, Main.ENV_ELEMENTAL_JETTY_CONFIG), () -> getFromSysPropOrEnv(Main.LEGACY_PROP_EXIST_JETTY_CONFIG, Main.LEGACY_ENV_EXIST_JETTY_CONFIG)).map(Paths::get);
if (!existJettyConfigFile.isPresent()) {
final Optional jettyHomeDir = getFromSysPropOrEnv(Main.PROP_JETTY_HOME, Main.ENV_JETTY_HOME).map(Paths::get);
@@ -767,12 +768,12 @@ private Path getJettyConfig(final Optional existHomeDir) {
existJettyConfigFile = jettyHomeDir.map(f -> f.resolve(Main.CONFIG_DIR_NAME).resolve(Main.STANDARD_ENABLED_JETTY_CONFIGS));
}
- if (existHomeDir.isPresent() && Files.exists(existHomeDir.get().resolve(Main.CONFIG_DIR_NAME))) {
- existJettyConfigFile = existHomeDir.map(f -> f.resolve(Main.CONFIG_DIR_NAME).resolve(Main.STANDARD_ENABLED_JETTY_CONFIGS));
+ if (elementalHomeDir.isPresent() && Files.exists(elementalHomeDir.get().resolve(Main.CONFIG_DIR_NAME))) {
+ existJettyConfigFile = elementalHomeDir.map(f -> f.resolve(Main.CONFIG_DIR_NAME).resolve(Main.STANDARD_ENABLED_JETTY_CONFIGS));
}
if (!existJettyConfigFile.isPresent()) {
- showMessageAndExit("Error Occurred", "ERROR: jetty config file could not be found! Make sure to set exist.jetty.config or EXIST_JETTY_CONFIG.", true);
+ showMessageAndExit("Error Occurred", "ERROR: jetty config file could not be found! Make sure to set elemental.jetty.config or ELEMENTAL_JETTY_CONFIG.", true);
System.exit(SystemExitCodes.CATCH_ALL_GENERAL_ERROR_EXIT_CODE);
}
}
@@ -888,7 +889,7 @@ public void actionPerformed(final ActionEvent actionEvent) {
return;
}
final Desktop desktop = Desktop.getDesktop();
- final Optional home = ConfigurationHelper.getExistHome();
+ final Optional home = ConfigurationHelper.getElementalHome();
final Path logFile = FileUtils.resolve(home, "logs/elemental.log");
diff --git a/exist-core/src/main/java/org/exist/launcher/LauncherWrapper.java b/exist-core/src/main/java/org/exist/launcher/LauncherWrapper.java
index b1a4828f17..20982fa2e0 100644
--- a/exist-core/src/main/java/org/exist/launcher/LauncherWrapper.java
+++ b/exist-core/src/main/java/org/exist/launcher/LauncherWrapper.java
@@ -156,7 +156,7 @@ private void run(final List args) throws IOException {
System.out.println(buf.toString());
final ProcessBuilder pb = new ProcessBuilder(args);
- final Optional home = ConfigurationHelper.getExistHome();
+ final Optional home = ConfigurationHelper.getElementalHome();
pb.directory(home.orElse(Paths.get(".")).toFile());
pb.redirectErrorStream(true);
pb.inheritIO();
@@ -194,16 +194,16 @@ protected void getJavaOpts(final List args, final Properties launcherPro
final Properties sysProps = System.getProperties();
for (final Map.Entry
-
- net.sf.saxon
- Saxon-HE
- ${saxon.version}
-
-
com.evolvedbinary.multilock
multilock
@@ -469,21 +462,6 @@
antlr-maven-plugin
2.2
-
- org.codehaus.mojo
- xml-maven-plugin
- 1.2.0
-
- net.sf.saxon.TransformerFactoryImpl
-
-
-
- net.sf.saxon
- Saxon-HE
- ${saxon.version}
-
-
-
org.apache.maven.plugins
maven-assembly-plugin
@@ -675,4 +653,4 @@
-
\ No newline at end of file
+
diff --git a/exist-start/pom.xml b/exist-start/pom.xml
index 448a16e9d2..1c499d8cf2 100644
--- a/exist-start/pom.xml
+++ b/exist-start/pom.xml
@@ -113,6 +113,7 @@
pom.xml
src/main/java/org/exist/start/CompatibleJavaVersionCheck.java
src/test/java/org/exist/start/CompatibleJavaVersionCheckTest.java
+ src/main/java/org/exist/start/LatestFileResolver.java
@@ -127,6 +128,7 @@
src/main/java/org/exist/start/Classpath.java
src/main/java/org/exist/start/CompatibleJavaVersionCheck.java
src/test/java/org/exist/start/CompatibleJavaVersionCheckTest.java
+ src/main/java/org/exist/start/LatestFileResolver.java
src/main/java/org/exist/start/Main.java
src/main/java/org/exist/start/Version.java
diff --git a/exist-start/src/main/java/org/exist/start/LatestFileResolver.java b/exist-start/src/main/java/org/exist/start/LatestFileResolver.java
index 5707c4c651..28e0381f5f 100644
--- a/exist-start/src/main/java/org/exist/start/LatestFileResolver.java
+++ b/exist-start/src/main/java/org/exist/start/LatestFileResolver.java
@@ -1,4 +1,28 @@
/*
+ * Elemental
+ * Copyright (C) 2024, Evolved Binary Ltd
+ *
+ * admin@evolvedbinary.com
+ * https://www.evolvedbinary.com | https://www.elemental.xyz
+ *
+ * This library 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; version 2.1.
+ *
+ * This library 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * NOTE: Parts of this file contain code from 'The eXist-db Authors'.
+ * The original license header is included below.
+ *
+ * =====================================================================
+ *
* eXist-db Open Source Native XML Database
* Copyright (C) 2001 The eXist-db Authors
*
@@ -30,6 +54,9 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import static org.exist.start.Main.LEGACY_PROP_EXIST_START_DEBUG;
+import static org.exist.start.Main.PROP_ELEMENTAL_START_DEBUG;
+
/**
* This class uses regex pattern matching to find the latest version of a
* particular jar file.
@@ -51,7 +78,7 @@ public class LatestFileResolver {
// Set debug mode for each file resolver instance based on whether or
// not the system was started with debugging turned on.
- private static boolean _debug = Boolean.getBoolean("exist.start.debug");
+ private static boolean _DEBUG = Boolean.parseBoolean(System.getProperty(PROP_ELEMENTAL_START_DEBUG, System.getProperty(LEGACY_PROP_EXIST_START_DEBUG, "false")));
/**
* If the passed file name contains a %latest% token,
@@ -98,7 +125,7 @@ public String getResolvedFileName(final String filename) {
if (!jars.isEmpty()) {
final String actualFileName = jars.get(0).toAbsolutePath().toString();
- if (_debug) {
+ if (_DEBUG) {
System.err.println(
"Found match: " + actualFileName
+ " for jar file pattern: " + filename
@@ -106,7 +133,7 @@ public String getResolvedFileName(final String filename) {
}
return actualFileName;
} else {
- if (_debug) {
+ if (_DEBUG) {
System.err.println(
"WARN: No latest version found for JAR file: '"
+ filename + "'"
diff --git a/exist-start/src/main/java/org/exist/start/Main.java b/exist-start/src/main/java/org/exist/start/Main.java
index e108a7b781..c4f214ba51 100644
--- a/exist-start/src/main/java/org/exist/start/Main.java
+++ b/exist-start/src/main/java/org/exist/start/Main.java
@@ -71,6 +71,7 @@
import java.nio.file.Paths;
import java.util.*;
import java.util.function.Predicate;
+import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -96,23 +97,38 @@ public class Main {
public static final String CONFIG_DIR_NAME = "etc";
- private static final String PROP_EXIST_START_DEBUG = "exist.start.debug";
- public static final String PROP_EXIST_JETTY_CONFIG = "exist.jetty.config";
- public static final String PROP_EXIST_HOME = "exist.home";
+ static final String PROP_ELEMENTAL_START_DEBUG = "elemental.start.debug";
+ @Deprecated
+ static final String LEGACY_PROP_EXIST_START_DEBUG = "exist.start.debug";
+
+ public static final String PROP_ELEMENTAL_JETTY_CONFIG = "elemental.jetty.config";
+ @Deprecated
+ public static final String LEGACY_PROP_EXIST_JETTY_CONFIG = "exist.jetty.config";
+
+ public static final String PROP_ELEMENTAL_HOME = "elemental.home";
+ @Deprecated
+ public static final String LEGACY_PROP_EXIST_HOME = "exist.home";
+
public static final String PROP_JETTY_HOME = "jetty.home";
private static final String PROP_LOG4J_CONFIGURATION_FILE = "log4j.configurationFile";
private static final String PROP_JUL_MANAGER = "java.util.logging.manager";
private static final String PROP_JAVA_TEMP_DIR = "java.io.tmpdir";
- public static final String ENV_EXIST_JETTY_CONFIG = "EXIST_JETTY_CONFIG";
- public static final String ENV_EXIST_HOME = "EXIST_HOME";
+ public static final String ENV_ELEMENTAL_JETTY_CONFIG = "ELEMENTAL_JETTY_CONFIG";
+ @Deprecated
+ public static final String LEGACY_ENV_EXIST_JETTY_CONFIG = "EXIST_JETTY_CONFIG";
+
+ public static final String ENV_ELEMENTAL_HOME = "ELEMENTAL_HOME";
+ @Deprecated
+ public static final String LEGACY_ENV_EXIST_HOME = "EXIST_HOME";
+
public static final String ENV_JETTY_HOME = "JETTY_HOME";
private static Main exist;
private String _mode = "jetty";
- private boolean _debug = Boolean.getBoolean(PROP_EXIST_START_DEBUG);
+ private final boolean _debug = Boolean.parseBoolean(System.getProperty(PROP_ELEMENTAL_START_DEBUG, System.getProperty(LEGACY_PROP_EXIST_START_DEBUG, "false")));
public static void main(final String[] args) {
try {
@@ -237,15 +253,15 @@ public void runEx(String[] args) throws StartException {
System.err.println("mode=" + _mode);
}
- // try and figure out exist home dir
- final Optional existHomeDir = getFromSysPropOrEnv(PROP_EXIST_HOME, ENV_EXIST_HOME).map(Paths::get);
+ // try and figure out Elemental home dir
+ final Optional elementalHomeDir = or(getFromSysPropOrEnv(PROP_ELEMENTAL_HOME, ENV_ELEMENTAL_HOME), () -> getFromSysPropOrEnv(LEGACY_PROP_EXIST_HOME, LEGACY_ENV_EXIST_HOME)).map(Paths::get);
// try to find Jetty
if ("jetty".equals(_mode) || "standalone".equals(_mode)) {
final Optional jettyHomeDir = getFromSysPropOrEnv(PROP_JETTY_HOME, ENV_JETTY_HOME).map(Paths::get);
- Optional existJettyConfigFile = getFromSysPropOrEnv(PROP_EXIST_JETTY_CONFIG, ENV_EXIST_JETTY_CONFIG).map(Paths::get);
- if (!existJettyConfigFile.isPresent()) {
+ Optional elementalJettyConfigFile = or(getFromSysPropOrEnv(PROP_ELEMENTAL_JETTY_CONFIG, ENV_ELEMENTAL_JETTY_CONFIG), () -> getFromSysPropOrEnv(LEGACY_PROP_EXIST_JETTY_CONFIG, LEGACY_ENV_EXIST_JETTY_CONFIG)).map(Paths::get);
+ if (!elementalJettyConfigFile.isPresent()) {
final String config;
if ("jetty".equals(_mode)) {
config = STANDARD_ENABLED_JETTY_CONFIGS;
@@ -254,21 +270,21 @@ public void runEx(String[] args) throws StartException {
}
if (jettyHomeDir.isPresent() && Files.exists(jettyHomeDir.get().resolve(CONFIG_DIR_NAME))) {
- existJettyConfigFile = jettyHomeDir.map(f -> f.resolve(CONFIG_DIR_NAME).resolve(config));
+ elementalJettyConfigFile = jettyHomeDir.map(f -> f.resolve(CONFIG_DIR_NAME).resolve(config));
}
- if (existHomeDir.isPresent() && Files.exists(existHomeDir.get().resolve(CONFIG_DIR_NAME))) {
- existJettyConfigFile = existHomeDir.map(f -> f.resolve(CONFIG_DIR_NAME).resolve(config));
+ if (elementalHomeDir.isPresent() && Files.exists(elementalHomeDir.get().resolve(CONFIG_DIR_NAME))) {
+ elementalJettyConfigFile = elementalHomeDir.map(f -> f.resolve(CONFIG_DIR_NAME).resolve(config));
}
- if (!existJettyConfigFile.isPresent()) {
- System.err.println("ERROR: jetty config file could not be found! Make sure to set exist.jetty.config or EXIST_JETTY_CONFIG.");
+ if (!elementalJettyConfigFile.isPresent()) {
+ System.err.println("ERROR: jetty config file could not be found! Make sure to set elemental.jetty.config or ELEMENTAL_JETTY_CONFIG.");
System.err.flush();
throw new StartException(ERROR_CODE_NO_JETTY_CONFIG);
}
}
final String[] jettyStartArgs = new String[1 + args.length];
- jettyStartArgs[0] = existJettyConfigFile.get().toAbsolutePath().toString();
+ jettyStartArgs[0] = elementalJettyConfigFile.get().toAbsolutePath().toString();
System.arraycopy(args, 0, jettyStartArgs, 1, args.length);
args = jettyStartArgs;
}
@@ -276,8 +292,8 @@ public void runEx(String[] args) throws StartException {
// find log4j2.xml
Optional log4jConfigurationFile = Optional.ofNullable(System.getProperty(PROP_LOG4J_CONFIGURATION_FILE)).map(Paths::get);
if (!log4jConfigurationFile.isPresent()) {
- if (existHomeDir.isPresent() && Files.exists(existHomeDir.get().resolve(CONFIG_DIR_NAME))) {
- log4jConfigurationFile = existHomeDir.map(f -> f.resolve(CONFIG_DIR_NAME).resolve("log4j2.xml"));
+ if (elementalHomeDir.isPresent() && Files.exists(elementalHomeDir.get().resolve(CONFIG_DIR_NAME))) {
+ log4jConfigurationFile = elementalHomeDir.map(f -> f.resolve(CONFIG_DIR_NAME).resolve("log4j2.xml"));
}
}
@@ -388,7 +404,7 @@ public void shutdownEx() throws StopException {
/**
* Copied from {@link org.exist.util.FileUtils#list(Path, Predicate)}
* as org.exist.start is compiled into a separate Jar and doesn't have
- * the rest of eXist available on the classpath
+ * the rest of Elemental available on the classpath
*/
static List list(final Path directory, final Predicate filter) throws IOException {
try(final Stream entries = Files.list(directory).filter(filter)) {
@@ -399,9 +415,22 @@ static List list(final Path directory, final Predicate filter) throw
/**
* Copied from {@link org.exist.util.FileUtils#fileName(Path)}
* as org.exist.start is compiled into a separate Jar and doesn't have
- * the rest of eXist available on the classpath
+ * the rest of Elemental available on the classpath
*/
static String fileName(final Path path) {
return path.getFileName().toString();
}
+
+ /**
+ * Copied from {@link com.evolvedbinary.j8fu.OptionalUtil#or(Optional, Supplier)}
+ * as org.exist.start is compiled into a separate Jar and doesn't have
+ * j8fu available on the classpath
+ */
+ static Optional or(final Optional left, final Supplier> right) {
+ if(left.isPresent()) {
+ return left;
+ } else {
+ return right.get();
+ }
+ }
}
diff --git a/extensions/contentextraction/pom.xml b/extensions/contentextraction/pom.xml
index fb728d667f..1e70fe3a70 100644
--- a/extensions/contentextraction/pom.xml
+++ b/extensions/contentextraction/pom.xml
@@ -212,6 +212,7 @@
true
+
org.apache.maven.plugins
maven-dependency-plugin
@@ -231,6 +232,31 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
diff --git a/extensions/contentextraction/src/test/resources-filtered/conf.xml b/extensions/contentextraction/src/test/resources-filtered/conf.xml
index 6d13e0b374..bc0f72d185 100644
--- a/extensions/contentextraction/src/test/resources-filtered/conf.xml
+++ b/extensions/contentextraction/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/debuggee/pom.xml b/extensions/debuggee/pom.xml
index 4c3484d092..3a4bb5580a 100644
--- a/extensions/debuggee/pom.xml
+++ b/extensions/debuggee/pom.xml
@@ -179,6 +179,31 @@
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
org.apache.maven.plugins
maven-surefire-plugin
@@ -187,7 +212,8 @@
CLDR,SPI
${project.build.testOutputDirectory}/log4j2.xml
- ${project.build.testOutputDirectory}/standalone-webapp
+ ${project.build.testOutputDirectory}/conf.xml
+ ${project.build.testOutputDirectory}/standalone-webapp
diff --git a/extensions/debuggee/src/test/resources-filtered/conf.xml b/extensions/debuggee/src/test/resources-filtered/conf.xml
index e9949d1b9b..5edf18da5a 100644
--- a/extensions/debuggee/src/test/resources-filtered/conf.xml
+++ b/extensions/debuggee/src/test/resources-filtered/conf.xml
@@ -46,746 +46,86 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
-
-
-
-
-
-
+ raise-error-on-failed-retrieval="no"/>
+
+
+
+
+
+
+
+
+
diff --git a/extensions/expath/pom.xml b/extensions/expath/pom.xml
index 59468b348a..28ece40034 100644
--- a/extensions/expath/pom.xml
+++ b/extensions/expath/pom.xml
@@ -197,6 +197,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/expath/src/test/resources-filtered/conf.xml b/extensions/expath/src/test/resources-filtered/conf.xml
index a8ad4c4504..0717d7d9e6 100644
--- a/extensions/expath/src/test/resources-filtered/conf.xml
+++ b/extensions/expath/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/exquery/restxq/pom.xml b/extensions/exquery/restxq/pom.xml
index 544c84aa29..6f9d53521f 100644
--- a/extensions/exquery/restxq/pom.xml
+++ b/extensions/exquery/restxq/pom.xml
@@ -289,6 +289,7 @@
+
org.apache.maven.plugins
maven-dependency-plugin
@@ -308,7 +309,33 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/extensions/exquery/restxq/src/test/resources-filtered/conf.xml b/extensions/exquery/restxq/src/test/resources-filtered/conf.xml
index aa098d21d7..f01de43e99 100644
--- a/extensions/exquery/restxq/src/test/resources-filtered/conf.xml
+++ b/extensions/exquery/restxq/src/test/resources-filtered/conf.xml
@@ -27,720 +27,73 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
+
@@ -767,24 +120,17 @@
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/images/README.md b/extensions/images/README.md
index a788ffaea2..3baa9db582 100644
--- a/extensions/images/README.md
+++ b/extensions/images/README.md
@@ -11,20 +11,7 @@ Rendered images can be cached on a file system path.
Installation
------------
-Get the Java Advanced Imaging jars for your platform from
-
-https://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-client-419417.html
-
-Please choose the CLASSPATH installation bundle. Open the downloaded archive and
-copy the contents of the lib/ folder to $EXIST_HOME/lib/user.
-
-- If you are on MacOSX, you can just extract the jai_codec.jar and jai_core.jar files from the Linux CLASSPATH installation bundle and place these in $EXIST_HOME/lib/user
-
-You should now be able to compile the servlet from EXIST_HOME with
-
-./build.sh -f extensions/images/build.xml
-
-Next, you need to register the servlet in EXIST_HOME/webapp/WEB-INF/web.xml as follows:
+Next, you need to register the servlet in ELEMENTAL_HOME/etc/webapp/WEB-INF/web.xml as follows:
ScaleImageJAI
@@ -43,7 +30,7 @@ Next, you need to register the servlet in EXIST_HOME/webapp/WEB-INF/web.xml as f
where "output-dir" should point to an existing directory on your server. To use
the servlet from Elemental, make sure your
-EXIST_HOME/webapp/WEB-INF/controller-config.xml has a mapping:
+ELEMENTAL_HOME/etc/webapp/WEB-INF/controller-config.xml has a mapping:
diff --git a/extensions/indexes/lucene/pom.xml b/extensions/indexes/lucene/pom.xml
index e0fce17537..3bcb369afc 100644
--- a/extensions/indexes/lucene/pom.xml
+++ b/extensions/indexes/lucene/pom.xml
@@ -349,6 +349,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/lucene/src/test/resources-filtered/conf.xml b/extensions/indexes/lucene/src/test/resources-filtered/conf.xml
index 3424baa6e1..08a146f9c0 100644
--- a/extensions/indexes/lucene/src/test/resources-filtered/conf.xml
+++ b/extensions/indexes/lucene/src/test/resources-filtered/conf.xml
@@ -46,501 +46,47 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
+ doc-ids="default" minDiskSpace="1024M">
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
@@ -551,359 +97,31 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/ngram/pom.xml b/extensions/indexes/ngram/pom.xml
index dcb4de706c..0172df4b8c 100644
--- a/extensions/indexes/ngram/pom.xml
+++ b/extensions/indexes/ngram/pom.xml
@@ -207,6 +207,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/ngram/src/test/resources-filtered/conf.xml b/extensions/indexes/ngram/src/test/resources-filtered/conf.xml
index 398f7280d1..cba7b31180 100644
--- a/extensions/indexes/ngram/src/test/resources-filtered/conf.xml
+++ b/extensions/indexes/ngram/src/test/resources-filtered/conf.xml
@@ -46,501 +46,47 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
+ doc-ids="default" minDiskSpace="1024M">
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
@@ -551,364 +97,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
+
@@ -928,24 +146,17 @@
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/range/pom.xml b/extensions/indexes/range/pom.xml
index cbd04c9d88..9865029f1e 100644
--- a/extensions/indexes/range/pom.xml
+++ b/extensions/indexes/range/pom.xml
@@ -226,6 +226,7 @@
+
org.apache.maven.plugins
maven-dependency-plugin
@@ -244,8 +245,34 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/extensions/indexes/range/src/test/resources-filtered/conf.xml b/extensions/indexes/range/src/test/resources-filtered/conf.xml
index 5fa6c6d215..15ffc3fcc4 100644
--- a/extensions/indexes/range/src/test/resources-filtered/conf.xml
+++ b/extensions/indexes/range/src/test/resources-filtered/conf.xml
@@ -46,501 +46,47 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
+ doc-ids="default" minDiskSpace="1024M">
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
@@ -554,364 +100,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
+
@@ -932,24 +150,17 @@
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/sort/pom.xml b/extensions/indexes/sort/pom.xml
index f8065e98ee..1ef95447b0 100644
--- a/extensions/indexes/sort/pom.xml
+++ b/extensions/indexes/sort/pom.xml
@@ -165,6 +165,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/sort/src/test/resources-filtered/conf.xml b/extensions/indexes/sort/src/test/resources-filtered/conf.xml
index 6da857c67b..875b865eb2 100644
--- a/extensions/indexes/sort/src/test/resources-filtered/conf.xml
+++ b/extensions/indexes/sort/src/test/resources-filtered/conf.xml
@@ -46,501 +46,47 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
+ doc-ids="default" minDiskSpace="1024M">
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
@@ -551,364 +97,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
+
@@ -928,24 +146,17 @@
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/spatial/hsql.bat b/extensions/indexes/spatial/hsql.bat
deleted file mode 100644
index e04ab25082..0000000000
--- a/extensions/indexes/spatial/hsql.bat
+++ /dev/null
@@ -1,24 +0,0 @@
-@REM
-@REM eXist-db Open Source Native XML Database
-@REM Copyright (C) 2001 The eXist-db Authors
-@REM
-@REM info@exist-db.org
-@REM http://www.exist-db.org
-@REM
-@REM This library is free software; you can redistribute it and/or
-@REM modify it under the terms of the GNU Lesser General Public
-@REM License as published by the Free Software Foundation; either
-@REM version 2.1 of the License, or (at your option) any later version.
-@REM
-@REM This library is distributed in the hope that it will be useful,
-@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
-@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-@REM Lesser General Public License for more details.
-@REM
-@REM You should have received a copy of the GNU Lesser General Public
-@REM License along with this library; if not, write to the Free Software
-@REM Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-@REM
-
-set EXIST_HOME=..\..\..
-java -Xmx200m -cp .\lib\hsqldb.jar org.hsqldb.util.DatabaseManagerSwing --url jdbc:hsqldb:%EXIST_HOME%\webapp\WEB-INF\data\spatial_index
diff --git a/extensions/indexes/spatial/hsql.sh b/extensions/indexes/spatial/hsql.sh
deleted file mode 100755
index d3cb53d700..0000000000
--- a/extensions/indexes/spatial/hsql.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env bash
-#
-# eXist-db Open Source Native XML Database
-# Copyright (C) 2001 The eXist-db Authors
-#
-# info@exist-db.org
-# http://www.exist-db.org
-#
-# This library 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.1 of the License, or (at your option) any later version.
-#
-# This library 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-
-# Run the HSQL Database Manager
-
-if [ -z "${EXIST_HOME}" ]; then
- EXIST_HOME="../../..";
-fi
-# set java options
-if [ -z "${CLIENT_JAVA_OPTIONS}" ]; then
- CLIENT_JAVA_OPTIONS="-Xms64m -Xmx256m -Dfile.encoding=UTF-8";
-fi
-
-HSQL_LIB="${EXIST_HOME}/extensions/indexes/spatial/lib"
-
-if [ "x$1" = "x" ]; then
- HSQL_DATA="${EXIST_HOME}/webapp/WEB-INF/data/spatial_index"
-else
- HSQL_DATA="${EXIST_HOME}/$1"
-fi
-
-JAVA_OPTIONS="${CLIENT_JAVA_OPTIONS} -cp ${HSQL_LIB}/hsqldb.jar"
-
-
-${JAVA_HOME}/bin/java ${JAVA_OPTIONS} org.hsqldb.util.DatabaseManagerSwing --url jdbc:hsqldb:${HSQL_DATA}
diff --git a/extensions/indexes/spatial/ivysettings.xml b/extensions/indexes/spatial/ivysettings.xml
deleted file mode 100644
index 3f7d31bcd9..0000000000
--- a/extensions/indexes/spatial/ivysettings.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/extensions/indexes/spatial/pom.xml b/extensions/indexes/spatial/pom.xml
index 4f54f69f7a..c1cd084b4d 100644
--- a/extensions/indexes/spatial/pom.xml
+++ b/extensions/indexes/spatial/pom.xml
@@ -304,8 +304,33 @@
- org.apache.maven.plugins
- maven-surefire-plugin
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
-
-
-
-
+ doc-ids="default" minDiskSpace="1024M">
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/cache/pom.xml b/extensions/modules/cache/pom.xml
index c4f2545081..57cd3cfe5b 100644
--- a/extensions/modules/cache/pom.xml
+++ b/extensions/modules/cache/pom.xml
@@ -192,6 +192,33 @@
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+ lazy-cache-conf.xml
+ non-lazy-cache-conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/cache/src/test/resources-filtered/conf.xml b/extensions/modules/cache/src/test/resources-filtered/conf.xml
index 5fa9b470a3..5499a3fb21 100644
--- a/extensions/modules/cache/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/cache/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/cache/src/test/resources-filtered/lazy-cache-conf.xml b/extensions/modules/cache/src/test/resources-filtered/lazy-cache-conf.xml
index 5fa9b470a3..5499a3fb21 100644
--- a/extensions/modules/cache/src/test/resources-filtered/lazy-cache-conf.xml
+++ b/extensions/modules/cache/src/test/resources-filtered/lazy-cache-conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/cache/src/test/resources-filtered/non-lazy-cache-conf.xml b/extensions/modules/cache/src/test/resources-filtered/non-lazy-cache-conf.xml
index 5f35cba3c4..dfe8071538 100644
--- a/extensions/modules/cache/src/test/resources-filtered/non-lazy-cache-conf.xml
+++ b/extensions/modules/cache/src/test/resources-filtered/non-lazy-cache-conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/compression/pom.xml b/extensions/modules/compression/pom.xml
index 99b4f688cc..573236ec8d 100644
--- a/extensions/modules/compression/pom.xml
+++ b/extensions/modules/compression/pom.xml
@@ -208,6 +208,31 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
diff --git a/extensions/modules/compression/src/test/resources-filtered/conf.xml b/extensions/modules/compression/src/test/resources-filtered/conf.xml
index d03a3413b9..f6c2fe20bb 100644
--- a/extensions/modules/compression/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/compression/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/counter/pom.xml b/extensions/modules/counter/pom.xml
index 38a5a50ce7..d4b1b871bf 100644
--- a/extensions/modules/counter/pom.xml
+++ b/extensions/modules/counter/pom.xml
@@ -186,6 +186,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/counter/src/test/resources-filtered/conf.xml b/extensions/modules/counter/src/test/resources-filtered/conf.xml
index 6d5c877b4e..aa5f7184af 100644
--- a/extensions/modules/counter/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/counter/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/expathrepo/expathrepo-trigger-test/pom.xml b/extensions/modules/expathrepo/expathrepo-trigger-test/pom.xml
index 64713909ec..66d618e336 100644
--- a/extensions/modules/expathrepo/expathrepo-trigger-test/pom.xml
+++ b/extensions/modules/expathrepo/expathrepo-trigger-test/pom.xml
@@ -156,6 +156,17 @@
+
+
+ src/test/resources
+ false
+
+
+ src/test/resources-filtered
+ true
+
+
+
com.mycila
@@ -190,7 +201,7 @@
pom.xml
xar-assembly.xml
- src/test/resources/conf.xml
+ src/test/resources-filtered/conf.xml
src/main/xar-resources/controller.xq
src/main/java/org/exist/repo/ExampleModule.java
src/test/java/org/exist/repo/ExampleModuleTest.java
@@ -206,7 +217,7 @@
pom.xml
xar-assembly.xml
- src/test/resources/conf.xml
+ src/test/resources-filtered/conf.xml
src/main/xar-resources/controller.xq
src/main/java/org/exist/repo/ExampleModule.java
src/test/java/org/exist/repo/ExampleModuleTest.java
@@ -223,6 +234,31 @@
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
ro.kuberam.maven.plugins
kuberam-expath-plugin
diff --git a/extensions/modules/expathrepo/expathrepo-trigger-test/src/test/resources-filtered/conf.xml b/extensions/modules/expathrepo/expathrepo-trigger-test/src/test/resources-filtered/conf.xml
new file mode 100644
index 0000000000..256a0e7585
--- /dev/null
+++ b/extensions/modules/expathrepo/expathrepo-trigger-test/src/test/resources-filtered/conf.xml
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/expathrepo/expathrepo-trigger-test/src/test/resources/conf.xml b/extensions/modules/expathrepo/expathrepo-trigger-test/src/test/resources/conf.xml
deleted file mode 100644
index 7dff31c75f..0000000000
--- a/extensions/modules/expathrepo/expathrepo-trigger-test/src/test/resources/conf.xml
+++ /dev/null
@@ -1,798 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extensions/modules/expathrepo/pom.xml b/extensions/modules/expathrepo/pom.xml
index 317a7cac71..d6eb4763f0 100644
--- a/extensions/modules/expathrepo/pom.xml
+++ b/extensions/modules/expathrepo/pom.xml
@@ -232,6 +232,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/expathrepo/src/test/resources-filtered/conf.xml b/extensions/modules/expathrepo/src/test/resources-filtered/conf.xml
index f445acf25b..2d756b7be5 100644
--- a/extensions/modules/expathrepo/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/expathrepo/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/file/pom.xml b/extensions/modules/file/pom.xml
index 9cb70c6401..eb6a1728cc 100644
--- a/extensions/modules/file/pom.xml
+++ b/extensions/modules/file/pom.xml
@@ -295,6 +295,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
org.apache.maven.plugins
maven-surefire-plugin
@@ -302,8 +328,8 @@
@{jacocoArgLine}
${project.basedir}/../../../exist-jetty-config/target/classes/org/exist/jetty
- ${project.build.testOutputDirectory}/conf.xml
- ${project.build.testOutputDirectory}/standalone-webapp
+ ${project.build.testOutputDirectory}/conf.xml
+ ${project.build.testOutputDirectory}/standalone-webapp
${project.build.testOutputDirectory}/log4j2.xml
diff --git a/extensions/modules/file/src/main/java/org/exist/xquery/modules/file/Sync.java b/extensions/modules/file/src/main/java/org/exist/xquery/modules/file/Sync.java
index 599fd05234..3844cf06c9 100644
--- a/extensions/modules/file/src/main/java/org/exist/xquery/modules/file/Sync.java
+++ b/extensions/modules/file/src/main/java/org/exist/xquery/modules/file/Sync.java
@@ -129,7 +129,7 @@ public class Sync extends BasicFunction {
new FunctionParameterSequenceType("collection", Type.STRING, Cardinality.EXACTLY_ONE,
"Absolute path to the collection to synchronize to disk."),
new FunctionParameterSequenceType("targetPath", Type.ITEM, Cardinality.EXACTLY_ONE,
- "The path or URI to the target directory. Relative paths resolve against EXIST_HOME."),
+ "The path or URI to the target directory. Relative paths resolve against ELEMENTAL_HOME."),
new FunctionParameterSequenceType("dateTimeOrOptionsMap", Type.ITEM, Cardinality.ZERO_OR_ONE,
"Options as map(*). The available settings are:" +
"\"" + PRUNE_OPT + "\": delete any file/dir that does not correspond to a doc/collection in the DB. " +
@@ -257,7 +257,7 @@ private Sequence startSync(
if (p.isAbsolute()) {
targetDir = p;
} else {
- final Optional home = context.getBroker().getConfiguration().getExistHome();
+ final Optional home = context.getBroker().getConfiguration().getElementalHome();
targetDir = FileUtils.resolve(home, target);
}
diff --git a/extensions/modules/file/src/test/resources-filtered/conf.xml b/extensions/modules/file/src/test/resources-filtered/conf.xml
index b462856f0f..274ee6a1c1 100644
--- a/extensions/modules/file/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/file/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/image/pom.xml b/extensions/modules/image/pom.xml
index 7623d98499..9a2661b9bf 100644
--- a/extensions/modules/image/pom.xml
+++ b/extensions/modules/image/pom.xml
@@ -159,7 +159,8 @@
+
-
\ No newline at end of file
+
diff --git a/extensions/modules/mail/pom.xml b/extensions/modules/mail/pom.xml
index c4eae1e198..edf8733974 100644
--- a/extensions/modules/mail/pom.xml
+++ b/extensions/modules/mail/pom.xml
@@ -269,6 +269,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/mail/src/test/resources-filtered/conf.xml b/extensions/modules/mail/src/test/resources-filtered/conf.xml
index 98d325c9e8..7d06db2f83 100644
--- a/extensions/modules/mail/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/mail/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/persistentlogin/pom.xml b/extensions/modules/persistentlogin/pom.xml
index f50f11f121..e9cdf7554d 100644
--- a/extensions/modules/persistentlogin/pom.xml
+++ b/extensions/modules/persistentlogin/pom.xml
@@ -168,15 +168,41 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
org.apache.maven.plugins
maven-surefire-plugin
@{jacocoArgLine} -Dfile.encoding=${project.build.sourceEncoding}
- ${project.build.testOutputDirectory}/conf.xml
+ ${project.build.testOutputDirectory}/conf.xml
${project.basedir}/../../../exist-jetty-config/target/classes/org/exist/jetty
- ${project.build.testOutputDirectory}/standalone-webapp
+ ${project.build.testOutputDirectory}/standalone-webapp
${project.build.testOutputDirectory}/log4j2.xml
diff --git a/extensions/modules/persistentlogin/src/test/resources-filtered/conf.xml b/extensions/modules/persistentlogin/src/test/resources-filtered/conf.xml
index 0126a7ccd6..43fbdc461d 100644
--- a/extensions/modules/persistentlogin/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/persistentlogin/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/process/pom.xml b/extensions/modules/process/pom.xml
index a1c2c0aba9..578b540852 100644
--- a/extensions/modules/process/pom.xml
+++ b/extensions/modules/process/pom.xml
@@ -102,6 +102,7 @@
pom.xml
+ src/main/java/org/exist/xquery/modules/process/Execute.java
@@ -112,6 +113,7 @@
${project.parent.relativePath}/../../exist-parent/existdb-LGPL-21-license.template.txt
pom.xml
+ src/main/java/org/exist/xquery/modules/process/Execute.java
diff --git a/extensions/modules/process/src/main/java/org/exist/xquery/modules/process/Execute.java b/extensions/modules/process/src/main/java/org/exist/xquery/modules/process/Execute.java
index 3fbef44dd5..5b0e8a392e 100644
--- a/extensions/modules/process/src/main/java/org/exist/xquery/modules/process/Execute.java
+++ b/extensions/modules/process/src/main/java/org/exist/xquery/modules/process/Execute.java
@@ -1,4 +1,28 @@
/*
+ * Elemental
+ * Copyright (C) 2024, Evolved Binary Ltd
+ *
+ * admin@evolvedbinary.com
+ * https://www.evolvedbinary.com | https://www.elemental.xyz
+ *
+ * This library 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; version 2.1.
+ *
+ * This library 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * NOTE: Parts of this file contain code from 'The eXist-db Authors'.
+ * The original license header is included below.
+ *
+ * =====================================================================
+ *
* eXist-db Open Source Native XML Database
* Copyright (C) 2001 The eXist-db Authors
*
@@ -152,7 +176,7 @@ private Path getWorkingDir(String arg) {
if (file.isAbsolute()) {
return file;
}
- final Optional home = context.getBroker().getConfiguration().getExistHome();
+ final Optional home = context.getBroker().getConfiguration().getElementalHome();
return FileUtils.resolve(home, arg);
}
diff --git a/extensions/modules/sql/pom.xml b/extensions/modules/sql/pom.xml
index a492f66035..fd9b853d45 100644
--- a/extensions/modules/sql/pom.xml
+++ b/extensions/modules/sql/pom.xml
@@ -245,6 +245,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/sql/src/test/resources-filtered/conf.xml b/extensions/modules/sql/src/test/resources-filtered/conf.xml
index ec48a5b6af..b8fa9fac78 100644
--- a/extensions/modules/sql/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/sql/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/xmldiff/pom.xml b/extensions/modules/xmldiff/pom.xml
index f2ebad9d7d..fed0b2221f 100644
--- a/extensions/modules/xmldiff/pom.xml
+++ b/extensions/modules/xmldiff/pom.xml
@@ -214,6 +214,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/xmldiff/src/test/resources-filtered/conf.xml b/extensions/modules/xmldiff/src/test/resources-filtered/conf.xml
index 3c77d2f52e..60921a715c 100644
--- a/extensions/modules/xmldiff/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/xmldiff/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/xslfo/pom.xml b/extensions/modules/xslfo/pom.xml
index 44c6e00090..3abcd239ea 100644
--- a/extensions/modules/xslfo/pom.xml
+++ b/extensions/modules/xslfo/pom.xml
@@ -256,6 +256,32 @@
true
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/xslfo/src/test/resources-filtered/conf.xml b/extensions/modules/xslfo/src/test/resources-filtered/conf.xml
index 2eac07bfa1..8d5496ddff 100644
--- a/extensions/modules/xslfo/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/xslfo/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/security/ldap/pom.xml b/extensions/security/ldap/pom.xml
index 98d2557347..87917e4620 100644
--- a/extensions/security/ldap/pom.xml
+++ b/extensions/security/ldap/pom.xml
@@ -166,6 +166,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/security/ldap/src/test/resources-filtered/conf.xml b/extensions/security/ldap/src/test/resources-filtered/conf.xml
index e9949d1b9b..74c5e2412e 100644
--- a/extensions/security/ldap/src/test/resources-filtered/conf.xml
+++ b/extensions/security/ldap/src/test/resources-filtered/conf.xml
@@ -46,746 +46,86 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
-
-
-
-
-
-
-
+ enforce-index-use="strict"
+ raise-error-on-failed-retrieval="no"/>
+
+
+
+
+
+
+
+
+
diff --git a/extensions/webdav/pom.xml b/extensions/webdav/pom.xml
index 331c7d6c13..55a84178d1 100644
--- a/extensions/webdav/pom.xml
+++ b/extensions/webdav/pom.xml
@@ -311,6 +311,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
org.apache.maven.plugins
maven-surefire-plugin
@@ -318,8 +344,8 @@
@{jacocoArgLine}
${project.basedir}/../../exist-jetty-config/target/classes/org/exist/jetty
- ${project.build.testOutputDirectory}/conf.xml
- ${project.build.testOutputDirectory}/standalone-webapp
+ ${project.build.testOutputDirectory}/conf.xml
+ ${project.build.testOutputDirectory}/standalone-webapp
${project.build.testOutputDirectory}/log4j2.xml
diff --git a/extensions/webdav/src/main/java/org/exist/webdav/ExistResourceFactory.java b/extensions/webdav/src/main/java/org/exist/webdav/ExistResourceFactory.java
index 7503145acb..5bf7bdce7e 100644
--- a/extensions/webdav/src/main/java/org/exist/webdav/ExistResourceFactory.java
+++ b/extensions/webdav/src/main/java/org/exist/webdav/ExistResourceFactory.java
@@ -109,9 +109,9 @@ public ExistResourceFactory() {
}
try {
- // 2) try and find overridden config relative to EXIST_HOME/etc
- final Optional eXistHome = brokerPool.getConfiguration().getExistHome();
- final Path config = FileUtils.resolve(eXistHome, "etc").resolve("webdav.properties");
+ // 2) try and find overridden config relative to ELEMENTAL_HOME/etc
+ final Optional elementalHome = brokerPool.getConfiguration().getElementalHome();
+ final Path config = FileUtils.resolve(elementalHome, "etc").resolve("webdav.properties");
// Read from file if existent
if (Files.isReadable(config)) {
diff --git a/extensions/webdav/src/test/resources-filtered/conf.xml b/extensions/webdav/src/test/resources-filtered/conf.xml
index e9949d1b9b..5edf18da5a 100644
--- a/extensions/webdav/src/test/resources-filtered/conf.xml
+++ b/extensions/webdav/src/test/resources-filtered/conf.xml
@@ -46,746 +46,86 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
-
-
-
-
-
-
+ raise-error-on-failed-retrieval="no"/>
+
+
+
+
+
+
+
+
+
diff --git a/extensions/xqdoc/pom.xml b/extensions/xqdoc/pom.xml
index 120c86af7d..246b0119bb 100644
--- a/extensions/xqdoc/pom.xml
+++ b/extensions/xqdoc/pom.xml
@@ -197,6 +197,32 @@
+
+
+ org.codehaus.mojo
+ xml-maven-plugin
+
+
+ validate-test-conf
+ process-test-resources
+
+ validate
+
+
+
+
+ true
+ ${project.build.testOutputDirectory}
+
+ conf.xml
+
+
+
+
+
+
+
+
diff --git a/extensions/xqdoc/src/test/resources-filtered/conf.xml b/extensions/xqdoc/src/test/resources-filtered/conf.xml
index 395e3f2e52..0979f5e0bb 100644
--- a/extensions/xqdoc/src/test/resources-filtered/conf.xml
+++ b/extensions/xqdoc/src/test/resources-filtered/conf.xml
@@ -46,720 +46,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/schema/conf.xsd b/schema/conf.xsd
index dee0be751b..671fbfb261 100644
--- a/schema/conf.xsd
+++ b/schema/conf.xsd
@@ -190,7 +190,7 @@
-
+
@@ -213,7 +213,7 @@
-
+
-
+
@@ -326,7 +326,24 @@
-
+
+
+
+ The Java classname of a parser which implements org.xml.sax.XMLReader
+ and is capable of parsing HTML and emitting an XML Sax Stream.
+
+ Whichever library you use for this, it must be present on the classpath.
+ See $ELEMENTAL_HOME/lib
+
+ Examples include:
+ - org.codelibs.nekohtml.parsers.SAXParser
+ The Cyber NekoHTML parser from https://sourceforge.net/projects/nekohtml/
+
+ - org.ccil.cowan.tagsoup.Parser
+ The TagSoup parser from http://home.ccil.org/~cowan/XML/tagsoup/
+
+
+
@@ -406,7 +423,7 @@
-
+
@@ -441,9 +458,32 @@
-
-
-
+
+
+
+ Defines the maximum number of page splits allowed within a document
+ before a defragmentation run will be triggered.
+
+
+
+
+
+
+ For debugging only. If the parameter is set to "yes", a consistency
+ check will be run on every modified document after every XUpdate
+ request. It checks if the persistent DOM is complete and all
+ pointers in the structural index point to valid storage addresses
+ containing valid nodes.
+
+
+
+
+
+
+ TODO
+
+
+