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

Commit b8cb64d

Browse files
committed
#127 Added support for mlContentDatabaseName
1 parent 76d5b3d commit b8cb64d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,18 @@ public AppConfig newAppConfig() {
143143
}
144144

145145
/**
146-
* When a REST API server is created, the name will default to mlAppName-modules. This property can be used to
147-
* override that name.
146+
* When a REST API server is created, the content database name will default to mlAppName-content. This property
147+
* can be used to override that name.
148+
*/
149+
prop = getProperty("mlContentDatabaseName");
150+
if (prop != null) {
151+
logger.info("Content database name: " + prop);
152+
c.setContentDatabaseName(prop);
153+
}
154+
155+
/**
156+
* When a REST API server is created, the modules database name will default to mlAppName-modules. This property
157+
* can be used to override that name.
148158
*/
149159
prop = getProperty("mlModulesDatabaseName");
150160
if (prop != null) {

src/test/java/com/marklogic/appdeployer/DefaultAppConfigFactoryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public void allProperties() {
5656
p.setProperty("mlAdditionalBinaryExtensions", ".gradle,.properties");
5757
p.setProperty("mlConfigPath", "src/test/resources/sample-app/empty-ml-config");
5858
p.setProperty("mlSimpleSsl", "anyvalue");
59+
p.setProperty("mlContentDatabaseName", "my-content-db");
5960
p.setProperty("mlModulesDatabaseName", "my-modules");
6061
p.setProperty("mlGroupName", "other-group");
6162
p.setProperty("mlAppServicesPort", "8123");
@@ -80,6 +81,7 @@ public void allProperties() {
8081
assertTrue(config.getConfigDir().getBaseDir().getAbsolutePath().contains("empty-ml-config"));
8182
assertNotNull(config.getRestSslContext());
8283
assertNotNull(config.getRestSslHostnameVerifier());
84+
assertEquals("my-content-db", config.getContentDatabaseName());
8385
assertEquals("my-modules", config.getModulesDatabaseName());
8486
assertEquals("other-group", config.getGroupName());
8587
assertEquals((Integer) 8123, config.getAppServicesPort());

0 commit comments

Comments
 (0)