Skip to content

Commit a734a61

Browse files
committed
Fixing some DMSDK issues
Doc fixes
1 parent 0fd41ff commit a734a61

File tree

11 files changed

+22
-25
lines changed

11 files changed

+22
-25
lines changed

examples/local-testing-project/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Set this to the version you used when running
22
# "gradle -Pversion=(something) publishToMavenLocal" on your local ml-gradle repo
3-
mlGradleVersion=2.9.0
3+
mlGradleVersion=3.0-beta1
44

55
mlHost=localhost
66
mlAppName=example

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.marklogic
2-
version=3.0-alpha3
3-
mlAppDeployerDependency=com.marklogic:ml-app-deployer:3.0-alpha3
2+
version=3.0-beta1
3+
mlAppDeployerDependency=com.marklogic:ml-app-deployer:3.0-beta1
44
mlcpUtilDependency=com.marklogic:mlcp-util:0.3.0
55

src/main/groovy/com/marklogic/gradle/MarkLogicPlugin.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import com.marklogic.gradle.task.datamovement.DeleteCollectionsTask
2727
import com.marklogic.gradle.task.datamovement.RemoveCollectionsTask
2828
import com.marklogic.gradle.task.datamovement.RemovePermissionsTask
2929
import com.marklogic.gradle.task.datamovement.SetCollectionsTask
30+
import com.marklogic.gradle.task.datamovement.SetPermissionsTask
3031
import com.marklogic.gradle.task.es.GenerateModelArtifactsTask
3132
import com.marklogic.gradle.task.export.ExportResourcesTask
3233
import com.marklogic.gradle.task.flexrep.*
@@ -128,7 +129,7 @@ class MarkLogicPlugin implements Plugin<Project> {
128129
project.task("mlSetContentUpdatesAllowed", type: SetContentUpdatesAllowedTask, group: dbGroup, description: "Sets updated-allowed on each primary forest for the content database; must set the mode via e.g. -Pmode=flash-backup")
129130

130131
String dmGroup = "ml-Gradle Data Movement"
131-
String dmGroupMessage = "; can also set the properties threadCount, batchSize, applyConsistentSnapshot, awaitCompletion, stopJob, " +
132+
String dmGroupMessage = "; can also set the properties threadCount, batchSize, applyConsistentSnapshot, " +
132133
"jobName, and logBatches to configure how the Data Movement QueryBatcher operates.";
133134
project.task("mlAddCollections", type: AddCollectionsTask, group: dmGroup, description: "Add all documents, either in a comma-separated list of " +
134135
"collection names specified by the 'whereCollections' property or matching a URI pattern specified by the 'whereUriPattern' property, " +
@@ -147,7 +148,7 @@ class MarkLogicPlugin implements Plugin<Project> {
147148
"to all documents either in the set of collection names specified by the 'collections' property or with URIs matching the pattern specified by the 'whereUriPattern' property" + dmGroupMessage)
148149
project.task("mlRemovePermissions", type: RemovePermissionsTask, group: dmGroup, description: "Remove permissions, specified as a comma-separated list of roles and capabilities via the 'permissions' property, " +
149150
"from all documents either in the set of collection names specified by the 'collections' property or with URIs matching the pattern specified by the 'whereUriPattern' property" + dmGroupMessage)
150-
project.task("mlSetPermissions", type: AddPermissionsTask, group: dmGroup, description: "Set permissions, specified as a comma-separated list of roles and capabilities via the 'permissions' property, " +
151+
project.task("mlSetPermissions", type: SetPermissionsTask, group: dmGroup, description: "Set permissions, specified as a comma-separated list of roles and capabilities via the 'permissions' property, " +
151152
"on all documents in the set of collection names specified by the 'collections' property or with URIs matching the pattern specified by the 'whereUriPattern' property" + dmGroupMessage)
152153

153154
String devGroup = "ml-gradle Development"

src/main/groovy/com/marklogic/gradle/task/datamovement/AddCollectionsTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AddCollectionsTask extends DataMovementTask {
1313
(!project.hasProperty("whereCollections") && !project.hasProperty("whereUriPattern")) ||
1414
!project.hasProperty("collections")
1515
) {
16-
println "Invalid inputs; " + getDescription()
16+
println "Invalid inputs; task description: " + getDescription()
1717
return;
1818
}
1919

src/main/groovy/com/marklogic/gradle/task/datamovement/AddPermissionsTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class AddPermissionsTask extends DataMovementTask {
1010
@TaskAction
1111
void addPermissions() {
1212
if ((!project.hasProperty("whereCollections") && !project.hasProperty("whereUriPattern")) || !project.hasProperty("permissions")) {
13-
println "Invalid input; " + getDescription()
13+
println "Invalid input; task description: " + getDescription()
1414
return;
1515
}
1616

src/main/groovy/com/marklogic/gradle/task/datamovement/DataMovementTask.groovy

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,9 @@ class DataMovementTask extends MarkLogicTask {
6464
* - threadCount
6565
* - batchSize
6666
* - applyConsistentSnapshot
67-
* - awaitCompletion
68-
* - stopJob
6967
* - jobName
70-
*
68+
* - logBatches
69+
*
7170
* Can override this method in a subclass to further configure the QueryBatcherTemplate that's returned.
7271
*
7372
* @param client
@@ -84,12 +83,6 @@ class DataMovementTask extends MarkLogicTask {
8483
if (project.hasProperty("applyConsistentSnapshot")) {
8584
t.setApplyConsistentSnapshot(Boolean.parseBoolean(project.property("applyConsistentSnapshot")))
8685
}
87-
if (project.hasProperty("awaitCompletion")) {
88-
t.setAwaitCompletion(Boolean.parseBoolean(project.property("awaitCompletion")))
89-
}
90-
if (project.hasProperty("stopJob")) {
91-
t.setStopJob(Boolean.parseBoolean(project.property("stopJob")))
92-
}
9386
if (project.hasProperty("jobName")) {
9487
t.setJobName(project.property("jobName"))
9588
}
@@ -103,7 +96,7 @@ class DataMovementTask extends MarkLogicTask {
10396
}
10497
})
10598
}
106-
99+
107100
return t
108101
}
109102
}

src/main/groovy/com/marklogic/gradle/task/datamovement/DeleteCollectionsTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DeleteCollectionsTask extends DataMovementTask {
88
@TaskAction
99
void deleteCollections() {
1010
if (!project.hasProperty("collections")) {
11-
println "Invalid inputs; " + getDescription()
11+
println "Invalid inputs; task description: " + getDescription()
1212
return
1313
}
1414

src/main/groovy/com/marklogic/gradle/task/datamovement/RemoveCollectionsTask.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.marklogic.gradle.task.datamovement
22

33
import com.marklogic.client.datamovement.QueryBatchListener
4+
import com.marklogic.client.ext.datamovement.CollectionsQueryBatcherBuilder
45
import com.marklogic.client.ext.datamovement.QueryBatcherBuilder
56
import com.marklogic.client.ext.datamovement.listener.RemoveCollectionsListener
67
import org.gradle.api.tasks.TaskAction
@@ -15,7 +16,7 @@ class RemoveCollectionsTask extends DataMovementTask {
1516
@TaskAction
1617
void removeCollections() {
1718
if (!project.hasProperty("collections")) {
18-
println "Invalid inputs; " + getDescription()
19+
println "Invalid inputs; task description: " + getDescription()
1920
return;
2021
}
2122

@@ -29,9 +30,11 @@ class RemoveCollectionsTask extends DataMovementTask {
2930
message = "documents matching URI pattern " + this.whereUriPattern + message
3031
}
3132
else {
32-
this.whereCollections = collections
3333
if (hasWhereCollectionsProperty()) {
3434
builder = constructBuilderFromWhereCollections()
35+
} else {
36+
this.whereCollections = collections
37+
builder = new CollectionsQueryBatcherBuilder(this.whereCollections)
3538
}
3639
message = "documents in collections " + Arrays.asList(this.whereCollections) + message
3740
}

src/main/groovy/com/marklogic/gradle/task/datamovement/RemovePermissionsTask.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class RemovePermissionsTask extends DataMovementTask {
1111

1212
@TaskAction
1313
void removePermissions() {
14-
if ((!project.hasProperty("collections") && !project.hasProperty("uriPattern")) || !project.hasProperty("permissions")) {
15-
println "Invalid input; " + getDescription()
14+
if ((!project.hasProperty("whereCollections") && !project.hasProperty("whereUriPattern")) || !project.hasProperty("permissions")) {
15+
println "Invalid input; task description: " + getDescription()
1616
return;
1717
}
1818

src/main/groovy/com/marklogic/gradle/task/datamovement/SetCollectionsTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SetCollectionsTask extends DataMovementTask {
1313
(!project.hasProperty("whereCollections") && !project.hasProperty("pattern")) ||
1414
!project.hasProperty("collections")
1515
) {
16-
println "Invalid inputs; " + getDescription()
16+
println "Invalid inputs; task description: " + getDescription()
1717
return;
1818
}
1919

0 commit comments

Comments
 (0)