Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 390a1bd

Browse files
committed
Merging in 2.1.0 features
1 parent 1eb9592 commit 390a1bd

File tree

52 files changed

+1270
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1270
-175
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/build/
55
.project
66
.classpath
7+
.idea
78
src/test/resources/user.properties
89
setenv.bat
910
src/test/resources/scaffold-test/

build.gradle

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ targetCompatibility = "1.7"
1111

1212
repositories {
1313
jcenter()
14+
mavenLocal()
1415
}
1516

1617
dependencies {
17-
compile 'com.marklogic:ml-javaclient-util:2.5'
18+
compile 'com.marklogic:ml-javaclient-util:2.8.0'
1819
compile 'jaxen:jaxen:1.1.6'
1920
compile 'org.apache.httpcomponents:httpclient:4.3.5'
2021
compile 'org.springframework:spring-web:4.1.5.RELEASE'
21-
testCompile 'com.marklogic:ml-junit:2.5'
22+
testCompile 'com.marklogic:ml-junit:2.6.0'
2223
}
2324

2425
// This ensures that Gradle includes in the published jar any non-java files under src/main/java
@@ -59,9 +60,15 @@ if (project.hasProperty("myBintrayUser")) {
5960
licenses = ['Apache-2.0']
6061
vcsUrl = 'https://github.com/rjrudin/' + project.name + '.git'
6162
version {
62-
name = "2.0"
63+
name = "2.1.0"
6364
released = new Date()
6465
}
6566
}
6667
}
67-
}
68+
}
69+
70+
71+
72+
task wrapper(type: Wrapper) {
73+
gradleVersion = '2.12'
74+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
group=com.marklogic
22
publishUrl=file:../gh-pages-marklogic-java/releases
33
javadocsDir=../gh-pages-marklogic-java/javadocs
4-
version=2.0
4+
version=2.1.0

gradle/wrapper/gradle-wrapper.jar

2.56 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon May 25 15:31:23 EDT 2015
1+
#Tue Mar 22 14:27:38 EDT 2016
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip

gradlew

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ case "`uname`" in
4242
;;
4343
esac
4444

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
5045
# Attempt to set APP_HOME
5146
# Resolve links: $0 may be a link
5247
PRG="$0"
@@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
6156
fi
6257
done
6358
SAVED="`pwd`"
64-
cd "`dirname \"$PRG\"`/" >&-
59+
cd "`dirname \"$PRG\"`/" >/dev/null
6560
APP_HOME="`pwd -P`"
66-
cd "$SAVED" >&-
61+
cd "$SAVED" >/dev/null
6762

6863
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6964

@@ -114,6 +109,7 @@ fi
114109
if $cygwin ; then
115110
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116111
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112+
JAVACMD=`cygpath --unix "$JAVACMD"`
117113

118114
# We build the pattern for arguments to be converted via cygpath
119115
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`

gradlew.bat

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
1-
@if "%DEBUG%" == "" @echo off
2-
@rem ##########################################################################
3-
@rem
4-
@rem Gradle startup script for Windows
5-
@rem
6-
@rem ##########################################################################
7-
8-
@rem Set local scope for the variables with windows NT shell
9-
if "%OS%"=="Windows_NT" setlocal
10-
11-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12-
set DEFAULT_JVM_OPTS=
13-
14-
set DIRNAME=%~dp0
15-
if "%DIRNAME%" == "" set DIRNAME=.
16-
set APP_BASE_NAME=%~n0
17-
set APP_HOME=%DIRNAME%
18-
19-
@rem Find java.exe
20-
if defined JAVA_HOME goto findJavaFromJavaHome
21-
22-
set JAVA_EXE=java.exe
23-
%JAVA_EXE% -version >NUL 2>&1
24-
if "%ERRORLEVEL%" == "0" goto init
25-
26-
echo.
27-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28-
echo.
29-
echo Please set the JAVA_HOME variable in your environment to match the
30-
echo location of your Java installation.
31-
32-
goto fail
33-
34-
:findJavaFromJavaHome
35-
set JAVA_HOME=%JAVA_HOME:"=%
36-
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37-
38-
if exist "%JAVA_EXE%" goto init
39-
40-
echo.
41-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42-
echo.
43-
echo Please set the JAVA_HOME variable in your environment to match the
44-
echo location of your Java installation.
45-
46-
goto fail
47-
48-
:init
49-
@rem Get command-line arguments, handling Windowz variants
50-
51-
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
53-
54-
:win9xME_args
55-
@rem Slurp the command line arguments.
56-
set CMD_LINE_ARGS=
57-
set _SKIP=2
58-
59-
:win9xME_args_slurp
60-
if "x%~1" == "x" goto execute
61-
62-
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
68-
69-
:execute
70-
@rem Setup the command line
71-
72-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73-
74-
@rem Execute Gradle
75-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76-
77-
:end
78-
@rem End local scope for the variables with windows NT shell
79-
if "%ERRORLEVEL%"=="0" goto mainEnd
80-
81-
:fail
82-
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83-
rem the _cmd.exe /c_ return code!
84-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85-
exit /b 1
86-
87-
:mainEnd
88-
if "%OS%"=="Windows_NT" endlocal
89-
90-
:omega
1+
@if "%DEBUG%" == "" @echo off
2+
@rem ##########################################################################
3+
@rem
4+
@rem Gradle startup script for Windows
5+
@rem
6+
@rem ##########################################################################
7+
8+
@rem Set local scope for the variables with windows NT shell
9+
if "%OS%"=="Windows_NT" setlocal
10+
11+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12+
set DEFAULT_JVM_OPTS=
13+
14+
set DIRNAME=%~dp0
15+
if "%DIRNAME%" == "" set DIRNAME=.
16+
set APP_BASE_NAME=%~n0
17+
set APP_HOME=%DIRNAME%
18+
19+
@rem Find java.exe
20+
if defined JAVA_HOME goto findJavaFromJavaHome
21+
22+
set JAVA_EXE=java.exe
23+
%JAVA_EXE% -version >NUL 2>&1
24+
if "%ERRORLEVEL%" == "0" goto init
25+
26+
echo.
27+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28+
echo.
29+
echo Please set the JAVA_HOME variable in your environment to match the
30+
echo location of your Java installation.
31+
32+
goto fail
33+
34+
:findJavaFromJavaHome
35+
set JAVA_HOME=%JAVA_HOME:"=%
36+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37+
38+
if exist "%JAVA_EXE%" goto init
39+
40+
echo.
41+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42+
echo.
43+
echo Please set the JAVA_HOME variable in your environment to match the
44+
echo location of your Java installation.
45+
46+
goto fail
47+
48+
:init
49+
@rem Get command-line arguments, handling Windows variants
50+
51+
if not "%OS%" == "Windows_NT" goto win9xME_args
52+
if "%@eval[2+2]" == "4" goto 4NT_args
53+
54+
:win9xME_args
55+
@rem Slurp the command line arguments.
56+
set CMD_LINE_ARGS=
57+
set _SKIP=2
58+
59+
:win9xME_args_slurp
60+
if "x%~1" == "x" goto execute
61+
62+
set CMD_LINE_ARGS=%*
63+
goto execute
64+
65+
:4NT_args
66+
@rem Get arguments from the 4NT Shell from JP Software
67+
set CMD_LINE_ARGS=%$
68+
69+
:execute
70+
@rem Setup the command line
71+
72+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
74+
@rem Execute Gradle
75+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76+
77+
:end
78+
@rem End local scope for the variables with windows NT shell
79+
if "%ERRORLEVEL%"=="0" goto mainEnd
80+
81+
:fail
82+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83+
rem the _cmd.exe /c_ return code!
84+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85+
exit /b 1
86+
87+
:mainEnd
88+
if "%OS%"=="Windows_NT" endlocal
89+
90+
:omega

src/main/java/com/marklogic/appdeployer/AppConfig.java

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ public class AppConfig {
5050
* The default path from which modules will be loaded into a modules database.
5151
*/
5252
public final static String DEFAULT_MODULES_PATH = "src/main/ml-modules";
53+
public final static String DEFAULT_SCHEMAS_PATH = "src/main/ml-schemas";
5354

5455
public final static String DEFAULT_HOST = "localhost";
5556
public final static String DEFAULT_GROUP = "Default";
5657

5758
private String name = DEFAULT_APP_NAME;
5859
private String host = DEFAULT_HOST;
59-
60+
6061
// Username/password combo for using the client REST API - e.g. to load modules
6162
private String restAdminUsername = DEFAULT_USERNAME;
6263
private String restAdminPassword = DEFAULT_PASSWORD;
@@ -78,6 +79,7 @@ public class AppConfig {
7879
private String schemasDatabaseName;
7980

8081
private List<String> modulePaths;
82+
private String schemasPath;
8183
private ConfigDir configDir;
8284

8385
// Passed into the TokenReplacer that subclasses of AbstractCommand use
@@ -100,14 +102,22 @@ public class AppConfig {
100102
// Comma-delimited string used for configuring forest replicas
101103
private String databaseNamesAndReplicaCounts;
102104

103-
public AppConfig() {
104-
this(DEFAULT_MODULES_PATH);
105+
// Path to use for DeployFlexrepCommand
106+
private String flexrepPath;
107+
108+
public AppConfig() {
109+
this(DEFAULT_MODULES_PATH, DEFAULT_SCHEMAS_PATH);
105110
}
106111

107-
public AppConfig(String defaultModulePath) {
112+
public AppConfig(String defaultModulePath) {
113+
this(defaultModulePath, DEFAULT_SCHEMAS_PATH);
114+
}
115+
116+
public AppConfig(String defaultModulePath, String defaultSchemasPath) {
108117
modulePaths = new ArrayList<String>();
109118
modulePaths.add(defaultModulePath);
110119
configDir = new ConfigDir();
120+
schemasPath = defaultSchemasPath;
111121
}
112122

113123
public void setSimpleSslConfig() {
@@ -135,6 +145,18 @@ public DatabaseClient newTestDatabaseClient() {
135145
return DatabaseClientFactory.newClient(getHost(), getTestRestPort(), getRestAdminUsername(),
136146
getRestAdminPassword(), getRestAuthentication(), getRestSslContext(), getRestSslHostnameVerifier());
137147
}
148+
149+
/**
150+
* Like newDatabaseClient, but connects to schemas database.
151+
*
152+
* @return
153+
*/
154+
public DatabaseClient newSchemasDatabaseClient() {
155+
return DatabaseClientFactory.newClient(getHost(), getRestPort(), getSchemasDatabaseName(),
156+
getRestAdminUsername(), getRestAdminPassword(), getRestAuthentication(),
157+
getRestSslContext(), getRestSslHostnameVerifier());
158+
}
159+
138160

139161
/**
140162
* @return an XccAssetLoader based on the configuration properties in this class
@@ -225,7 +247,7 @@ public String getTriggersDatabaseName() {
225247
public String getSchemasDatabaseName() {
226248
return schemasDatabaseName != null ? schemasDatabaseName : name + "-schemas";
227249
}
228-
250+
229251
/**
230252
* @return the name of the application, which is then used to generate app server and database names unless those
231253
* are set via their respective properties
@@ -294,6 +316,17 @@ public void setTestRestPort(Integer testRestPort) {
294316
this.testRestPort = testRestPort;
295317
}
296318

319+
/**
320+
* @return a list of all the paths from which modules should be loaded into a REST API server modules database
321+
*/
322+
public String getSchemasPath() {
323+
return schemasPath;
324+
}
325+
326+
public void setSchemasPath(String schemasPath) {
327+
this.schemasPath = schemasPath;
328+
}
329+
297330
/**
298331
* @return a list of all the paths from which modules should be loaded into a REST API server modules database
299332
*/
@@ -459,4 +492,11 @@ public void setAssetFileFilter(FileFilter assetFileFilter) {
459492
this.assetFileFilter = assetFileFilter;
460493
}
461494

495+
public String getFlexrepPath() {
496+
return flexrepPath;
497+
}
498+
499+
public void setFlexrepPath(String flexrepPath) {
500+
this.flexrepPath = flexrepPath;
501+
}
462502
}

0 commit comments

Comments
 (0)