Skip to content

Commit 3232812

Browse files
authored
Merge pull request #200 from evolvedbinary/6.x.x/feature/support-calabash3
[6.x.x] Support for executing XQuery from XML Calabash 3
2 parents b0eb715 + dad57da commit 3232812

30 files changed

Lines changed: 1130 additions & 345 deletions

elemental-parent/pom.xml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,9 @@
374374
<version>3.4.0</version>
375375
</plugin>
376376
<plugin>
377-
<groupId>com.code54.mojo</groupId>
378-
<artifactId>buildversion-plugin</artifactId>
379-
<version>1.0.3</version>
377+
<groupId>com.evolvedbinary.maven.plugins</groupId>
378+
<artifactId>buildversion-maven-plugin</artifactId>
379+
<version>2.0.0</version>
380380
</plugin>
381381
<plugin>
382382
<groupId>org.apache.maven.plugins</groupId>
@@ -620,8 +620,8 @@
620620
</executions>
621621
</plugin>
622622
<plugin>
623-
<groupId>com.code54.mojo</groupId>
624-
<artifactId>buildversion-plugin</artifactId>
623+
<groupId>com.evolvedbinary.maven.plugins</groupId>
624+
<artifactId>buildversion-maven-plugin</artifactId>
625625
<executions>
626626
<execution>
627627
<phase>validate</phase>
@@ -814,19 +814,4 @@
814814
</profile>
815815
</profiles>
816816

817-
<pluginRepositories>
818-
<pluginRepository>
819-
<id>clojars.org</id>
820-
<url>https://clojars.org/repo</url>
821-
</pluginRepository>
822-
</pluginRepositories>
823-
824-
<distributionManagement>
825-
<repository>
826-
<id>central-ossrh-staging</id>
827-
<name>Central Portal - OSSRH Staging API</name>
828-
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/</url>
829-
</repository>
830-
</distributionManagement>
831-
832817
</project>

exist-core/src/main/java/org/exist/Namespaces.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public interface Namespaces {
6060
String DTD_NS = XMLConstants.XML_DTD_NS_URI;
6161

6262
String SCHEMA_NS = XMLConstants.W3C_XML_SCHEMA_NS_URI;
63+
String SCHEMA_NS_PREFIX = "xs";
6364
String SCHEMA_DATATYPES_NS = "http://www.w3.org/2001/XMLSchema-datatypes";
6465
String SCHEMA_INSTANCE_NS = XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI;
6566

exist-core/src/main/java/org/exist/client/CommandlineOptions.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ public class CommandlineOptions {
8383
.description("do not make embedded mode available")
8484
.defaultValue(false)
8585
.build();
86+
private static final Argument<Boolean> noAutoDeployArg = optionArgument("-a", "--no-auto-deploy")
87+
.description("Disable auto-deployment of EXPath Packages")
88+
.defaultValue(false)
89+
.build();
8690

8791

8892
/* gui arguments */
@@ -168,7 +172,7 @@ private static Optional<XmldbURI> optUri(final ParsedArguments parsedArguments,
168172

169173
public static CommandlineOptions parse(final String[] args) throws ArgumentException, URISyntaxException {
170174
final ParsedArguments arguments = CommandLineParser
171-
.withArguments(userArg, passwordArg, useSslArg, embeddedArg, embeddedConfigArg, noEmbeddedModeArg)
175+
.withArguments(userArg, passwordArg, useSslArg, embeddedArg, embeddedConfigArg, noEmbeddedModeArg, noAutoDeployArg)
172176
.andArguments(noGuiArg, guiQueryDialogArg)
173177
.andArguments(mkColArg, rmColArg, setColArg)
174178
.andArguments(parseDocsArg, getDocArg, rmDocArg)
@@ -189,6 +193,7 @@ public static CommandlineOptions parse(final String[] args) throws ArgumentExcep
189193
final boolean embedded = getBool(arguments, embeddedArg);
190194
final Optional<Path> embeddedConfig = getPathOpt(arguments, embeddedConfigArg);
191195
final boolean noEmbeddedMode = getBool(arguments, noEmbeddedModeArg);
196+
final boolean noAutoDeploy = getBool(arguments, noAutoDeployArg);
192197

193198
final boolean startGUI = !getBool(arguments, noGuiArg);
194199
final boolean openQueryGUI = getBool(arguments, guiQueryDialogArg);
@@ -233,6 +238,7 @@ public static CommandlineOptions parse(final String[] args) throws ArgumentExcep
233238
embedded,
234239
embeddedConfig,
235240
noEmbeddedMode,
241+
noAutoDeploy,
236242
startGUI,
237243
openQueryGUI,
238244
mkCol,
@@ -252,7 +258,7 @@ public static CommandlineOptions parse(final String[] args) throws ArgumentExcep
252258
);
253259
}
254260

255-
public CommandlineOptions(boolean quiet, boolean verbose, Optional<Path> outputFile, Map<String, String> options, Optional<String> username, Optional<String> password, boolean useSSL, boolean embedded, Optional<Path> embeddedConfig, boolean noEmbeddedMode, boolean startGUI, boolean openQueryGUI, Optional<XmldbURI> mkCol, Optional<XmldbURI> rmCol, Optional<XmldbURI> setCol, List<Path> parseDocs, Optional<XmldbURI> getDoc, Optional<String> rmDoc, Optional<String> xpath, List<Path> queryFiles, Optional<Integer> howManyResults, Optional<Path> traceQueriesFile, Optional<String> setDoc, Optional<Path> xupdateFile, boolean reindex, boolean reindexRecurse) {
261+
public CommandlineOptions(boolean quiet, boolean verbose, Optional<Path> outputFile, Map<String, String> options, Optional<String> username, Optional<String> password, boolean useSSL, boolean embedded, Optional<Path> embeddedConfig, boolean noEmbeddedMode, boolean noAutoDeploy, boolean startGUI, boolean openQueryGUI, Optional<XmldbURI> mkCol, Optional<XmldbURI> rmCol, Optional<XmldbURI> setCol, List<Path> parseDocs, Optional<XmldbURI> getDoc, Optional<String> rmDoc, Optional<String> xpath, List<Path> queryFiles, Optional<Integer> howManyResults, Optional<Path> traceQueriesFile, Optional<String> setDoc, Optional<Path> xupdateFile, boolean reindex, boolean reindexRecurse) {
256262
this.quiet = quiet;
257263
this.verbose = verbose;
258264
this.outputFile = outputFile;
@@ -263,6 +269,7 @@ public CommandlineOptions(boolean quiet, boolean verbose, Optional<Path> outputF
263269
this.embedded = embedded;
264270
this.embeddedConfig = embeddedConfig;
265271
this.noEmbeddedMode = noEmbeddedMode;
272+
this.noAutoDeploy = noAutoDeploy;
266273
this.startGUI = startGUI;
267274
this.openQueryGUI = openQueryGUI;
268275
this.mkCol = mkCol;
@@ -292,6 +299,7 @@ public CommandlineOptions(boolean quiet, boolean verbose, Optional<Path> outputF
292299
final boolean embedded;
293300
final Optional<Path> embeddedConfig;
294301
final boolean noEmbeddedMode;
302+
final boolean noAutoDeploy;
295303

296304
final boolean startGUI;
297305
final boolean openQueryGUI;

exist-core/src/main/java/org/exist/client/InteractiveClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public class InteractiveClient {
147147
public static final String CREATE_DATABASE = "create-database";
148148
public static final String LOCAL_MODE = "local-mode-opt";
149149
public static final String NO_EMBED_MODE = "NO_EMBED_MODE";
150+
public static final String NO_AUTO_DEPLOY = "no-autodeploy";
150151

151152
// values
152153
protected static final String EDIT_CMD = "emacsclient -t $file";
@@ -155,6 +156,7 @@ public class InteractiveClient {
155156
protected static final String SSL_ENABLE_DEFAULT = "FALSE";
156157
protected static final String LOCAL_MODE_DEFAULT = "FALSE";
157158
protected static final String NO_EMBED_MODE_DEFAULT = "FALSE";
159+
protected static final String NO_AUTO_DEPLOY_DEFAULT = "FALSE";
158160
protected static final String USER_DEFAULT = SecurityManager.DBA_USER;
159161

160162
protected static final String driver = "org.exist.xmldb.DatabaseImpl";
@@ -173,6 +175,7 @@ public class InteractiveClient {
173175
defaultProps.setProperty(PERMISSIONS, "false");
174176
defaultProps.setProperty(EXPAND_XINCLUDES, "true");
175177
defaultProps.setProperty(SSL_ENABLE, SSL_ENABLE_DEFAULT);
178+
defaultProps.setProperty(NO_AUTO_DEPLOY, NO_AUTO_DEPLOY_DEFAULT);
176179
}
177180

178181
protected static final int colSizes[] = new int[]{10, 10, 10, -1};
@@ -333,6 +336,7 @@ protected void connect() throws Exception {
333336
// Configure database
334337
database.setProperty(CREATE_DATABASE, "true");
335338
database.setProperty(SSL_ENABLE, properties.getProperty(SSL_ENABLE));
339+
database.setProperty(NO_AUTO_DEPLOY, properties.getProperty(NO_AUTO_DEPLOY));
336340

337341
// secure empty configuration
338342
final String configProp = properties.getProperty(InteractiveClient.CONFIGURATION);
@@ -1971,6 +1975,9 @@ protected void setPropertiesFromCommandLine(final CommandlineOptions options, fi
19711975
if(options.noEmbeddedMode) {
19721976
props.setProperty(NO_EMBED_MODE, "TRUE");
19731977
}
1978+
if (options.noAutoDeploy) {
1979+
props.setProperty(NO_AUTO_DEPLOY, "TRUE");
1980+
}
19741981
}
19751982

19761983
/**

exist-core/src/main/java/org/exist/collections/MutableCollection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public MutableDocumentSet allDocs(final DBBroker broker, final MutableDocumentSe
481481
if(recursive && subColls != null) {
482482
// process the child collections
483483
for(final XmldbURI subCol : subColls) {
484-
try(final Collection child = broker.openCollection(subCol, NO_LOCK)) { // NOTE: the recursive call below to child.addDocs will take a lock
484+
try(final Collection child = broker.openCollection(subCol, INTENTION_READ)) { // NOTE: the recursive call below to child.addDocs will take a lock
485485
//A collection may have been removed in the meantime, so check first
486486
if(child != null) {
487487
child.allDocs(broker, docs, recursive, lockMap);

0 commit comments

Comments
 (0)