diff --git a/elemental-parent/pom.xml b/elemental-parent/pom.xml
index d92ea5656b..0c3d3e2598 100644
--- a/elemental-parent/pom.xml
+++ b/elemental-parent/pom.xml
@@ -105,6 +105,7 @@
4.0.4
4.0.6
2.0.17
+ 9.9.1-8
1C
@@ -130,6 +131,12 @@
1.0.0
+
+ net.sf.saxon
+ Saxon-HE
+ ${saxon.version}
+
+
com.evolvedbinary.j8fu
j8fu
@@ -224,6 +231,21 @@
jaxb-maven-plugin
4.0.12
+
+ 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 faa9df1c63..13235a7ca6 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 68d805ffc4..a4a436b96c 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"/>
+
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/exist-core/pom.xml b/exist-core/pom.xml
index 2e5b76faa4..677e244476 100644
--- a/exist-core/pom.xml
+++ b/exist-core/pom.xml
@@ -759,6 +759,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
@@ -783,6 +784,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
@@ -823,6 +825,7 @@
src/test/xquery/xquery3/parse-xml.xqm
src/test/xquery/xquery3/serialize.xql
src/test/xquery/xquery3/xml-to-json.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
@@ -830,11 +833,14 @@
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/ExportMain.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
@@ -1073,6 +1079,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
@@ -1150,6 +1157,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
@@ -1157,6 +1165,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
@@ -1204,6 +1213,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
@@ -1631,6 +1641,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
@@ -1655,6 +1666,7 @@
src/test/xquery/xquery3/postfix-expr.xqm
src/test/xquery/xquery3/serialize.xql
src/test/xquery/xquery3/xml-to-json.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
@@ -1662,11 +1674,14 @@
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/ExportMain.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
@@ -1930,6 +1945,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
@@ -1989,6 +2005,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
@@ -2061,6 +2078,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
@@ -2072,6 +2090,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
@@ -2123,6 +2143,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
@@ -2453,6 +2474,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
@@ -2687,6 +2709,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
@@ -2936,6 +2959,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
@@ -2960,8 +3012,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
@@ -3068,8 +3120,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 d50d380164..35b1741d1a 100644
--- a/exist-core/src/main/java/org/exist/backup/ExportGUI.java
+++ b/exist-core/src/main/java/org/exist/backup/ExportGUI.java
@@ -123,10 +123,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());
@@ -431,7 +431,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 434eebc43e..05e1472505 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
*
@@ -34,6 +58,8 @@
import java.nio.file.Paths;
import java.util.Properties;
+import static org.exist.backup.BackupDescriptor.BACKUP_PROPERTIES;
+
/**
* Implementation of BackupWriter that writes to the file system.
@@ -128,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 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 bf20ad4cf8..662cbdc7ac 100644
--- a/exist-core/src/main/java/org/exist/backup/Main.java
+++ b/exist-core/src/main/java/org/exist/backup/Main.java
@@ -74,6 +74,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.*;
@@ -162,15 +163,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
@@ -227,7 +228,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 d9eae3b9cb..f8c57f4778 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;
/**
@@ -178,31 +180,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());
}
@@ -216,12 +219,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;
@@ -242,7 +243,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) {
@@ -265,6 +266,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 9b2d476285..ed4acdf129 100644
--- a/exist-core/src/main/java/org/exist/client/InteractiveClient.java
+++ b/exist-core/src/main/java/org/exist/client/InteractiveClient.java
@@ -2163,7 +2163,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
final Optional configFile = applyDefaultConfig(home);
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 99ce65eaaf..a77bb325cc 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,78 +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;
- }
- return switch (value.toLowerCase()) {
- case "yes", "true" -> true;
- case "no", "false" -> false;
- default -> 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 f4847c7f8b..28cb6c4b45 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 02792236bf..04ab6810bf 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
@@ -143,7 +143,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 90af131cae..978ddc47a1 100644
--- a/exist-core/src/main/java/org/exist/jetty/JettyStart.java
+++ b/exist-core/src/main/java/org/exist/jetty/JettyStart.java
@@ -191,7 +191,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 +275,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 +302,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.clazz())) {
configuredStartupTriggers.remove(configuredStartupTrigger);
@@ -310,11 +311,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 9c491206ba..4071789f49 100644
--- a/exist-core/src/main/java/org/exist/launcher/ConfigurationDialog.java
+++ b/exist-core/src/main/java/org/exist/launcher/ConfigurationDialog.java
@@ -628,7 +628,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 88c97adc67..b462c9defb 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..e183af7075 100644
--- a/exist-core/src/main/java/org/exist/launcher/Launcher.java
+++ b/exist-core/src/main/java/org/exist/launcher/Launcher.java
@@ -160,10 +160,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 = getFromSysPropOrEnv(Main.PROP_ELEMENTAL_HOME, Main.ENV_ELEMENTAL_HOME).or(() -> 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();
@@ -759,7 +759,7 @@ public void update(final Observable observable, final Object o) {
private Path getJettyConfig(final Optional existHomeDir) {
- Optional existJettyConfigFile = getFromSysPropOrEnv(Main.PROP_EXIST_JETTY_CONFIG, Main.ENV_EXIST_JETTY_CONFIG).map(Paths::get);
+ Optional existJettyConfigFile = getFromSysPropOrEnv(Main.PROP_ELEMENTAL_JETTY_CONFIG, Main.ENV_ELEMENTAL_JETTY_CONFIG).or(() -> 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);
@@ -772,7 +772,7 @@ private Path getJettyConfig(final Optional existHomeDir) {
}
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 +888,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 f5709eb15c..6a2c47c79b 100644
--- a/exist-core/src/main/java/org/exist/launcher/LauncherWrapper.java
+++ b/exist-core/src/main/java/org/exist/launcher/LauncherWrapper.java
@@ -171,7 +171,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();
@@ -212,16 +212,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
@@ -486,21 +479,6 @@
antlr-maven-plugin
2.4
-
- 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
diff --git a/exist-start/pom.xml b/exist-start/pom.xml
index 2d76509758..d141a48297 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 2f6b8f10f8..ad283fc955 100644
--- a/exist-start/src/main/java/org/exist/start/Main.java
+++ b/exist-start/src/main/java/org/exist/start/Main.java
@@ -97,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 {
@@ -242,15 +257,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 = getFromSysPropOrEnv(PROP_ELEMENTAL_HOME, ENV_ELEMENTAL_HOME).or(() -> 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 = getFromSysPropOrEnv(PROP_ELEMENTAL_JETTY_CONFIG, ENV_ELEMENTAL_JETTY_CONFIG).or(() -> 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;
@@ -259,21 +274,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;
}
@@ -281,8 +296,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"));
}
}
@@ -396,7 +411,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)) {
@@ -407,7 +422,7 @@ 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();
diff --git a/extensions/contentextraction/pom.xml b/extensions/contentextraction/pom.xml
index 206e13aa35..6742485394 100644
--- a/extensions/contentextraction/pom.xml
+++ b/extensions/contentextraction/pom.xml
@@ -217,6 +217,7 @@
true
+
org.apache.maven.plugins
maven-dependency-plugin
@@ -236,6 +237,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 dc48e3a273..a9053457cc 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 8130776496..50f30c1a17 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 1c58d39412..a6703e87fd 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 c70da2ecdf..ca33084b94 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 032b0b6ccf..5392f35216 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 0387aaa2a9..c924d25c15 100644
--- a/extensions/exquery/restxq/pom.xml
+++ b/extensions/exquery/restxq/pom.xml
@@ -301,6 +301,7 @@
+
org.apache.maven.plugins
maven-dependency-plugin
@@ -322,14 +323,40 @@
+
+
+ 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
${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/exquery/restxq/src/test/resources-filtered/conf.xml b/extensions/exquery/restxq/src/test/resources-filtered/conf.xml
index 9ddf8c7506..0a0fdbb8b2 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"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
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/indexes-integration-tests/pom.xml b/extensions/indexes/indexes-integration-tests/pom.xml
index 307a3e0c43..df4a9c91c5 100644
--- a/extensions/indexes/indexes-integration-tests/pom.xml
+++ b/extensions/indexes/indexes-integration-tests/pom.xml
@@ -210,6 +210,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/indexes-integration-tests/src/test/resources-filtered/conf.xml b/extensions/indexes/indexes-integration-tests/src/test/resources-filtered/conf.xml
index 85b561fa5d..17b642597b 100644
--- a/extensions/indexes/indexes-integration-tests/src/test/resources-filtered/conf.xml
+++ b/extensions/indexes/indexes-integration-tests/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">
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
@@ -552,359 +98,31 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/lucene/pom.xml b/extensions/indexes/lucene/pom.xml
index f510e7474f..a984109cd3 100644
--- a/extensions/indexes/lucene/pom.xml
+++ b/extensions/indexes/lucene/pom.xml
@@ -345,6 +345,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 955f7c6b1c..a6f7d5ff4b 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 1d2f8c1ae6..4135ebda4d 100644
--- a/extensions/indexes/ngram/pom.xml
+++ b/extensions/indexes/ngram/pom.xml
@@ -205,6 +205,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 e6d05b83c9..155c102fe4 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 9f6f5d5a49..26987c27bd 100644
--- a/extensions/indexes/range/pom.xml
+++ b/extensions/indexes/range/pom.xml
@@ -226,16 +226,7 @@
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- org.apache.logging.log4j:log4j-slf4j-impl
- org.apache.logging.log4j:log4j-slf4j2-impl
-
-
-
+
org.apache.maven.plugins
maven-dependency-plugin
@@ -254,6 +245,42 @@
+
+
+ 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
+
+
+ org.apache.logging.log4j:log4j-slf4j-impl
+ org.apache.logging.log4j:log4j-slf4j2-impl
+
+
+
diff --git a/extensions/indexes/range/src/test/resources-filtered/conf.xml b/extensions/indexes/range/src/test/resources-filtered/conf.xml
index 86a8fe14a9..acb8ffb5cf 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"/>
+
-
-
-
-
-
+
@@ -933,24 +151,17 @@
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/indexes/sort/pom.xml b/extensions/indexes/sort/pom.xml
index da9720305c..91fa9d33a8 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 819a4320a5..1802f0b575 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 960a6b2bf4..097ff51a03 100644
--- a/extensions/indexes/spatial/pom.xml
+++ b/extensions/indexes/spatial/pom.xml
@@ -290,6 +290,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/spatial/src/test/resources-filtered/conf.xml b/extensions/indexes/spatial/src/test/resources-filtered/conf.xml
index df0c2ffa20..bbc1df8fb6 100644
--- a/extensions/indexes/spatial/src/test/resources-filtered/conf.xml
+++ b/extensions/indexes/spatial/src/test/resources-filtered/conf.xml
@@ -46,892 +46,109 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
+ doc-ids="default" minDiskSpace="1024M">
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/cache/pom.xml b/extensions/modules/cache/pom.xml
index b12b5ac135..8601ba2fc1 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 e6feb2736c..e4575696ec 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 e6feb2736c..e4575696ec 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 5c3d87c0fc..ab010bc875 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 c2ecef4356..276795d3b3 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 520ba15fff..1657bc19bb 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 ead4082885..a59d2a2154 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 cbf3fe882c..74fd23f7ef 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 4737fb007c..b94c34371e 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 5ef4110fde..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 c23b38264b..f0bd2c6ebf 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 271e3c5c60..a1f58ce6cf 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 d9e4e066f3..90903c8271 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 98b3183a9a..388c3b293d 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 b0e7fccbe7..2e318343b6 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 3ffefa2f03..ff8fc98faa 100644
--- a/extensions/modules/image/pom.xml
+++ b/extensions/modules/image/pom.xml
@@ -208,6 +208,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/image/src/test/resources-filtered/conf.xml b/extensions/modules/image/src/test/resources-filtered/conf.xml
index 9df613700e..bd1cc18f4f 100644
--- a/extensions/modules/image/src/test/resources-filtered/conf.xml
+++ b/extensions/modules/image/src/test/resources-filtered/conf.xml
@@ -22,720 +22,73 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+ match-tagging-elements="no"/>
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/extensions/modules/mail/pom.xml b/extensions/modules/mail/pom.xml
index 5de5f60757..7be5533bcc 100644
--- a/extensions/modules/mail/pom.xml
+++ b/extensions/modules/mail/pom.xml
@@ -283,6 +283,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 586ba3e656..fc7af772fe 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 1871f838fe..5d40e3ae5f 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 ccfd32538a..ff35612292 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 ac379a9032..5efd52ae19 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 d62b505925..73f609c995 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 339602a0b9..c9850ad022 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 0ec3748934..59f61c65a9 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 e31d9c5b06..cb9de2430d 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 21a19a4bab..12c6d4ced4 100644
--- a/extensions/modules/xslfo/pom.xml
+++ b/extensions/modules/xslfo/pom.xml
@@ -234,6 +234,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 4e4cc3526d..bca3dce46c 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 af9ce24af3..ba08c7f6d3 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 5caafe4437..a835756741 100644
--- a/extensions/webdav/pom.xml
+++ b/extensions/webdav/pom.xml
@@ -307,6 +307,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
@@ -314,8 +340,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 5868e478ce..e71df08047 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 1c58d39412..a6703e87fd 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 ab771fb0ec..5ed774343c 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 947d6f897c..d3c6b6e053 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 c445e7367b..d82e2d4a5a 100644
--- a/schema/conf.xsd
+++ b/schema/conf.xsd
@@ -628,7 +628,7 @@
-
+
@@ -687,7 +687,7 @@
-
+
@@ -765,7 +765,7 @@
-
+
@@ -964,8 +964,8 @@
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
- perhaps the best way to do this is to place it into $EXIST_HOME/lib/user
+ Whichever library you use for this, it must be present on the classpath.
+ See $ELEMENTAL_HOME/lib
Examples include:
- org.codelibs.nekohtml.parsers.SAXParser
@@ -1199,7 +1199,7 @@
-
+
@@ -1328,7 +1328,7 @@
-
+
Load this configuration into Saxon
@@ -1338,8 +1338,8 @@
- If `configuration-file` is a relative filename, it is relative to $EXIST_HOME/etc
- (this is the same directory as the eXist-db configuration file `conf.xml`)
+ If `configuration-file` is a relative filename, it is relative to $ELEMENTAL_HOME/etc
+ (this is the same directory as the Elemental configuration file `conf.xml`)
`configuration-file` may also be an absolute filename.