From 90a523faa15e561b2fdb8fe764db0272d3e8abc8 Mon Sep 17 00:00:00 2001 From: Bill Miller Date: Fri, 20 Oct 2017 17:41:41 -0400 Subject: [PATCH 1/4] Added sample project for deploying Redaction Rulesets using Gradle. Also included optional Gradle task for validating Redaction Rulesets anytime after deploying --- examples/redaction-ruleset-project/.gitignore | 6 ++ examples/redaction-ruleset-project/README.md | 15 +++++ .../redaction-ruleset-project/build.gradle | 60 +++++++++++++++++++ .../gradle.properties | 5 ++ .../ml-config/databases/content-database.json | 4 ++ .../ml-config/databases/schemas-database.json | 3 + .../corb/redaction-rules-uris.xqy | 10 ++++ .../corb/validate-redaction-rules.xqy | 17 ++++++ .../redactionRules/collections.properties | 5 ++ .../main/ml-schemas/redactionRules/email.json | 12 ++++ .../redactionRules/permissions.properties | 5 ++ .../main/ml-schemas/redactionRules/ssn.json | 12 ++++ 12 files changed, 154 insertions(+) create mode 100644 examples/redaction-ruleset-project/.gitignore create mode 100644 examples/redaction-ruleset-project/README.md create mode 100644 examples/redaction-ruleset-project/build.gradle create mode 100644 examples/redaction-ruleset-project/gradle.properties create mode 100644 examples/redaction-ruleset-project/src/main/ml-config/databases/content-database.json create mode 100644 examples/redaction-ruleset-project/src/main/ml-config/databases/schemas-database.json create mode 100644 examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy create mode 100644 examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy create mode 100644 examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/collections.properties create mode 100644 examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/email.json create mode 100644 examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/permissions.properties create mode 100644 examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/ssn.json diff --git a/examples/redaction-ruleset-project/.gitignore b/examples/redaction-ruleset-project/.gitignore new file mode 100644 index 000000000..2b1e2f3ae --- /dev/null +++ b/examples/redaction-ruleset-project/.gitignore @@ -0,0 +1,6 @@ +/bin +.classpath +.project +/build +.gradle +.settings diff --git a/examples/redaction-ruleset-project/README.md b/examples/redaction-ruleset-project/README.md new file mode 100644 index 000000000..65a92213e --- /dev/null +++ b/examples/redaction-ruleset-project/README.md @@ -0,0 +1,15 @@ +This project shows an example of how MarkLogic 9 Redaction Rulesets can be loaded into a schemas +database from src/main/ml-schemas (the default path - this can be overridden via +mlSchemasPath). + +Note that in order for this to work, the content-database.json file must specify the schema +database that it's associated with. And in most cases, you'll want your own schemas database - not the default Schemas one - so schemas-database.json can be used to create own with a name based on mlAppName. + +Within each folder containing one or more Redaction Rulesets, you must provide a **collecitons.properties** and **permissions.properties** file. +These files contain the definitions for the applicable collections to be applied to the rulesets as well as the document permissions. + +***Note***: Rulesets must have a .json or .xml file extension. + +See [Specifying collections and permissions](https://github.com/marklogic-community/ml-javaclient-util/wiki/Loading-files#specifying-collections-and-permissions) for information on how to appliy the collections and permission when the rulesets are loaded + +See [Redacting Document Content](http://docs.marklogic.com/guide/app-dev/redaction) for more information on redacting content diff --git a/examples/redaction-ruleset-project/build.gradle b/examples/redaction-ruleset-project/build.gradle new file mode 100644 index 000000000..a5ccccc45 --- /dev/null +++ b/examples/redaction-ruleset-project/build.gradle @@ -0,0 +1,60 @@ +buildscript { + repositories { + jcenter() + // Needed for corb dependency: XCC + maven { url "http://developer.marklogic.com/maven2/" } + } + dependencies { + //Needed for CorbTask to dynamicaly generate properties from CORB Options class + classpath 'com.marklogic:marklogic-corb:2.3.2' + } +} + +plugins { + id "com.marklogic.ml-gradle" version "3.0.0" +} + +repositories { + jcenter() + + // Needed for corb dependency: XCC + maven { url "http://developer.marklogic.com/maven2/" } +} + +configurations { + // This configuration captures the dependencies for running corb (Content Reprocessing in Bulk). + // This is only needed if you want to run corb via Gradle tasks. + // If you do, using com.marklogic.gradle.task.CorbTask is a useful starting point, as shown below. + corb +} + +dependencies { + // required to run CoRB2 + corb 'com.marklogic:marklogic-corb:2.3.2' + // optional + //corb 'org.jasypt:jasypt:1.9.2' // would be necessary to leverage JasyptDecrypter +} + +/* + * ml-gradle adds an instance of com.marklogic.appdeployer.AppConfig to the Gradle project under the key "mlAppConfig". + * This instance can be modified to affect the behavior of ml-gradle. + */ +ext { + // mlAppConfig is an instance of com.marklogic.appdeployer.AppConfig + mlAppConfig { + // XCC URL for running corb task below and for creating triggers on pre-8.0-4 builds of MarkLogic + contentXccUrl = "xcc://${mlUsername}:${mlPassword}@${mlHost}:${mlRestPort}" + } +} + +/* + * This optional task demonstrates validating redaction rules via a locally run CORB process. + * To execute this task simply run it after you have successfully deployed the redaction rulesets (via mlAppDeploy or mlLoadSchemas). + */ +task validateRedactionRulesetsAdhoc(type: com.marklogic.gradle.task.CorbTask) { + xccConnectionUri = contentXccUrl + urisModule = "src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy|ADHOC" + processModule = "src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy|ADHOC" + +} + diff --git a/examples/redaction-ruleset-project/gradle.properties b/examples/redaction-ruleset-project/gradle.properties new file mode 100644 index 000000000..33bbf429a --- /dev/null +++ b/examples/redaction-ruleset-project/gradle.properties @@ -0,0 +1,5 @@ +mlHost=localhost +mlAppName=redaction-project +mlRestPort=8130 +mlUsername=admin +mlPassword=admin diff --git a/examples/redaction-ruleset-project/src/main/ml-config/databases/content-database.json b/examples/redaction-ruleset-project/src/main/ml-config/databases/content-database.json new file mode 100644 index 000000000..593bca40b --- /dev/null +++ b/examples/redaction-ruleset-project/src/main/ml-config/databases/content-database.json @@ -0,0 +1,4 @@ +{ + "database-name": "%%DATABASE%%", + "schema-database": "%%SCHEMAS_DATABASE%%" +} \ No newline at end of file diff --git a/examples/redaction-ruleset-project/src/main/ml-config/databases/schemas-database.json b/examples/redaction-ruleset-project/src/main/ml-config/databases/schemas-database.json new file mode 100644 index 000000000..f0f14c748 --- /dev/null +++ b/examples/redaction-ruleset-project/src/main/ml-config/databases/schemas-database.json @@ -0,0 +1,3 @@ +{ + "database-name": "%%SCHEMAS_DATABASE%%" +} \ No newline at end of file diff --git a/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy b/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy new file mode 100644 index 000000000..3c5c7b325 --- /dev/null +++ b/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy @@ -0,0 +1,10 @@ +xquery version "1.0-ml"; + +let $uris := + xdmp:invoke-function( + function() { cts:uris((), (), cts:directory-query("/redactionRules/")) }, + + {xdmp:database("redaction-project-schemas")} + ) + +return (count($uris), $uris) diff --git a/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy b/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy new file mode 100644 index 000000000..86c4a3f5d --- /dev/null +++ b/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy @@ -0,0 +1,17 @@ +xquery version "1.0-ml"; +import module namespace rdt = "http://marklogic.com/xdmp/redaction" at "/MarkLogic/redaction.xqy"; + + +declare variable $URI external; + +let $collections := + xdmp:invoke-function( + function() { xdmp:document-get-collections($URI) }, + + {xdmp:database("redaction-project-schemas")} + ) + + +return rdt:rule-validate(($collections)) + + diff --git a/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/collections.properties b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/collections.properties new file mode 100644 index 000000000..4b7d77789 --- /dev/null +++ b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/collections.properties @@ -0,0 +1,5 @@ +#Add one or more collecitons to add the ruleset to (comma separated) +# Example: file.json=collection1,collection2 + +ssn.json=security-rules,pii-rules +email.json=security-rules,email-rules diff --git a/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/email.json b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/email.json new file mode 100644 index 000000000..ac94638b3 --- /dev/null +++ b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/email.json @@ -0,0 +1,12 @@ +{ + "rule": { + "description": "hide email addresses", + "path": "//email", + "method": { + "function": "redact-email" + }, + "options": { + "pattern": "partial" + } + } +} diff --git a/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/permissions.properties b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/permissions.properties new file mode 100644 index 000000000..fe33b66c2 --- /dev/null +++ b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/permissions.properties @@ -0,0 +1,5 @@ +# Add one or more document permissions to apply to the ruleset +# Example - file.json= + +ssn.json=rest-reader,read,rest-writer,update +email.json=rest-reader,read,rest-writer,update diff --git a/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/ssn.json b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/ssn.json new file mode 100644 index 000000000..0e8e4d457 --- /dev/null +++ b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/ssn.json @@ -0,0 +1,12 @@ +{ + "rule": { + "description": "hide SSNs", + "path": "//ssn", + "method": { + "function": "redact-us-ssn" + }, + "options": { + "pattern": "partial" + } + } +} From 92db544e39bcc1360db1c0054855db653da16479 Mon Sep 17 00:00:00 2001 From: Bill Miller Date: Mon, 23 Oct 2017 20:18:25 -0400 Subject: [PATCH 2/4] Updated per Pull Request comments. --- examples/redaction-ruleset-project/README.md | 6 +++--- examples/redaction-ruleset-project/build.gradle | 12 +++--------- .../ml-schemas/redactionRules/collections.properties | 2 +- .../ml-schemas/redactionRules/permissions.properties | 5 ----- 4 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/permissions.properties diff --git a/examples/redaction-ruleset-project/README.md b/examples/redaction-ruleset-project/README.md index 65a92213e..3b461add0 100644 --- a/examples/redaction-ruleset-project/README.md +++ b/examples/redaction-ruleset-project/README.md @@ -5,11 +5,11 @@ mlSchemasPath). Note that in order for this to work, the content-database.json file must specify the schema database that it's associated with. And in most cases, you'll want your own schemas database - not the default Schemas one - so schemas-database.json can be used to create own with a name based on mlAppName. -Within each folder containing one or more Redaction Rulesets, you must provide a **collecitons.properties** and **permissions.properties** file. -These files contain the definitions for the applicable collections to be applied to the rulesets as well as the document permissions. +Within each folder containing one or more Redaction Rulesets, you must provide a **collections.properties** and (optionally) a **permissions.properties** file. +These files contain the definitions for the applicable collections to be applied to the rulesets as well as the document permissions (if included). ***Note***: Rulesets must have a .json or .xml file extension. -See [Specifying collections and permissions](https://github.com/marklogic-community/ml-javaclient-util/wiki/Loading-files#specifying-collections-and-permissions) for information on how to appliy the collections and permission when the rulesets are loaded +See [Specifying collections and permissions](https://github.com/marklogic-community/ml-javaclient-util/wiki/Loading-files#specifying-collections-and-permissions) for information on how to apply the collections and permission when the rulesets are loaded See [Redacting Document Content](http://docs.marklogic.com/guide/app-dev/redaction) for more information on redacting content diff --git a/examples/redaction-ruleset-project/build.gradle b/examples/redaction-ruleset-project/build.gradle index a5ccccc45..601bc5889 100644 --- a/examples/redaction-ruleset-project/build.gradle +++ b/examples/redaction-ruleset-project/build.gradle @@ -5,7 +5,7 @@ buildscript { maven { url "http://developer.marklogic.com/maven2/" } } dependencies { - //Needed for CorbTask to dynamicaly generate properties from CORB Options class + //Needed for CorbTask below classpath 'com.marklogic:marklogic-corb:2.3.2' } } @@ -22,27 +22,21 @@ repositories { } configurations { - // This configuration captures the dependencies for running corb (Content Reprocessing in Bulk). - // This is only needed if you want to run corb via Gradle tasks. - // If you do, using com.marklogic.gradle.task.CorbTask is a useful starting point, as shown below. + // Needed to run corb task below. corb } - dependencies { // required to run CoRB2 corb 'com.marklogic:marklogic-corb:2.3.2' // optional - //corb 'org.jasypt:jasypt:1.9.2' // would be necessary to leverage JasyptDecrypter } - /* * ml-gradle adds an instance of com.marklogic.appdeployer.AppConfig to the Gradle project under the key "mlAppConfig". * This instance can be modified to affect the behavior of ml-gradle. */ ext { - // mlAppConfig is an instance of com.marklogic.appdeployer.AppConfig mlAppConfig { - // XCC URL for running corb task below and for creating triggers on pre-8.0-4 builds of MarkLogic + // XCC URL for running corb task below contentXccUrl = "xcc://${mlUsername}:${mlPassword}@${mlHost}:${mlRestPort}" } } diff --git a/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/collections.properties b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/collections.properties index 4b7d77789..3d8db9c51 100644 --- a/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/collections.properties +++ b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/collections.properties @@ -1,4 +1,4 @@ -#Add one or more collecitons to add the ruleset to (comma separated) +#Add one or more collections to add the ruleset to (comma separated) # Example: file.json=collection1,collection2 ssn.json=security-rules,pii-rules diff --git a/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/permissions.properties b/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/permissions.properties deleted file mode 100644 index fe33b66c2..000000000 --- a/examples/redaction-ruleset-project/src/main/ml-schemas/redactionRules/permissions.properties +++ /dev/null @@ -1,5 +0,0 @@ -# Add one or more document permissions to apply to the ruleset -# Example - file.json= - -ssn.json=rest-reader,read,rest-writer,update -email.json=rest-reader,read,rest-writer,update From b080b618fc845e69250d1ccd66237aab357f18a9 Mon Sep 17 00:00:00 2001 From: Bill Miller Date: Tue, 31 Oct 2017 19:55:36 -0400 Subject: [PATCH 3/4] Swapping CORB for MLCP Remved CORB task for validating redaction and replaced it with MCLP task --- .../redaction-ruleset-project/build.gradle | 87 +++++++++++++------ .../data/import/sample1.json | 0 .../data/import/sample10.json | 0 .../data/import/sample2.json | 0 .../data/import/sample3.json | 0 .../data/import/sample4.json | 0 .../data/import/sample5.json | 0 .../data/import/sample6.json | 0 .../data/import/sample7.json | 0 .../data/import/sample8.json | 0 .../data/import/sample9.json | 0 .../lib/log4j.properties | 8 ++ 12 files changed, 68 insertions(+), 27 deletions(-) create mode 100644 examples/redaction-ruleset-project/data/import/sample1.json create mode 100644 examples/redaction-ruleset-project/data/import/sample10.json create mode 100644 examples/redaction-ruleset-project/data/import/sample2.json create mode 100644 examples/redaction-ruleset-project/data/import/sample3.json create mode 100644 examples/redaction-ruleset-project/data/import/sample4.json create mode 100644 examples/redaction-ruleset-project/data/import/sample5.json create mode 100644 examples/redaction-ruleset-project/data/import/sample6.json create mode 100644 examples/redaction-ruleset-project/data/import/sample7.json create mode 100644 examples/redaction-ruleset-project/data/import/sample8.json create mode 100644 examples/redaction-ruleset-project/data/import/sample9.json create mode 100644 examples/redaction-ruleset-project/lib/log4j.properties diff --git a/examples/redaction-ruleset-project/build.gradle b/examples/redaction-ruleset-project/build.gradle index 601bc5889..76603af9d 100644 --- a/examples/redaction-ruleset-project/build.gradle +++ b/examples/redaction-ruleset-project/build.gradle @@ -1,54 +1,87 @@ buildscript { repositories { jcenter() - // Needed for corb dependency: XCC + // Needed for mlcp dependency: XCC maven { url "http://developer.marklogic.com/maven2/" } } dependencies { - //Needed for CorbTask below - classpath 'com.marklogic:marklogic-corb:2.3.2' + classpath "com.marklogic:marklogic-contentpump:9.0.3" + classpath "com.marklogic:ml-gradle:3.0.0" } } -plugins { - id "com.marklogic.ml-gradle" version "3.0.0" -} +apply plugin: "com.marklogic.ml-gradle" repositories { jcenter() - - // Needed for corb dependency: XCC + // Needed for mlcp dependency maven { url "http://developer.marklogic.com/maven2/" } + maven { url "http://repository.cloudera.com/artifactory/cloudera-repos/" } } configurations { - // Needed to run corb task below. - corb + mlcp { + resolutionStrategy { + force "xml-apis:xml-apis:1.4.01" + } + } } + + dependencies { - // required to run CoRB2 - corb 'com.marklogic:marklogic-corb:2.3.2' - // optional + mlcp "com.marklogic:mlcp:9.0.3" + mlcp files("lib") } + +/*************************************************************** + Optional tasks to test redaction of data +***************************************************************/ + /* - * ml-gradle adds an instance of com.marklogic.appdeployer.AppConfig to the Gradle project under the key "mlAppConfig". - * This instance can be modified to affect the behavior of ml-gradle. - */ -ext { - mlAppConfig { - // XCC URL for running corb task below - contentXccUrl = "xcc://${mlUsername}:${mlPassword}@${mlHost}:${mlRestPort}" - } +* The import task below is an example of using the built-in MLCP Task in ml-gradle and will import sample JSON +* documents to the specified content database while applying the applicable collections to the content so that +* the redaction rules can be applied +* */ +task importSampleRedactionData(type: com.marklogic.gradle.task.MlcpTask) { + description = "Example of using mlcp and MlcpTask to import documents to test redaction rules" + classpath = configurations.mlcp + command = "IMPORT" + database = mlAppConfig.contentDatabaseName + input_file_path = "data/import" + output_collections = "security-rules,pii-rules,email-rules" + output_permissions = "rest-reader,read,rest-writer,update" + output_uri_replace = ".*import,'/import'" + logOutputUri = "/redaction.txt" } + /* - * This optional task demonstrates validating redaction rules via a locally run CORB process. - * To execute this task simply run it after you have successfully deployed the redaction rulesets (via mlAppDeploy or mlLoadSchemas). +* The export task below shows an example of using JavaExec inside Gradle to invoke MLCP to export the documents. +* This task, while a useful example, must be invoked this way because the built-in MLCP task does not yet recognize +* the "redaction" option being passed. This will be addressed in a future release. +* Exported documents will be within this project folder under /data/export +* */ +task exportSampleRedactionData(type: JavaExec) { + classpath = configurations.mlcp + main = 'com.marklogic.contentpump.ContentPump' + + args = [ + "EXPORT", + "-host", "${mlHost}", + "-port", "8130", + "-username", "${mlUsername}", + "-password", "${mlPassword}", + "-database", mlAppConfig.contentDatabaseName, + "-output_file_path", "data/export", + "-collection_filter", "security-rules", + "-redaction", "security-rules"] + /* + * Applying "security-rules" as the redaction collection will redact both email and SSN fields in the documents + * You may also redact just the email or ths SSN fields individually by applying only those specific collections + * i.e. "pii-rules" OR "email-rules" + */ -task validateRedactionRulesetsAdhoc(type: com.marklogic.gradle.task.CorbTask) { - xccConnectionUri = contentXccUrl - urisModule = "src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy|ADHOC" - processModule = "src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy|ADHOC" } + diff --git a/examples/redaction-ruleset-project/data/import/sample1.json b/examples/redaction-ruleset-project/data/import/sample1.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample10.json b/examples/redaction-ruleset-project/data/import/sample10.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample2.json b/examples/redaction-ruleset-project/data/import/sample2.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample3.json b/examples/redaction-ruleset-project/data/import/sample3.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample4.json b/examples/redaction-ruleset-project/data/import/sample4.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample5.json b/examples/redaction-ruleset-project/data/import/sample5.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample6.json b/examples/redaction-ruleset-project/data/import/sample6.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample7.json b/examples/redaction-ruleset-project/data/import/sample7.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample8.json b/examples/redaction-ruleset-project/data/import/sample8.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/data/import/sample9.json b/examples/redaction-ruleset-project/data/import/sample9.json new file mode 100644 index 000000000..e69de29bb diff --git a/examples/redaction-ruleset-project/lib/log4j.properties b/examples/redaction-ruleset-project/lib/log4j.properties new file mode 100644 index 000000000..1da823016 --- /dev/null +++ b/examples/redaction-ruleset-project/lib/log4j.properties @@ -0,0 +1,8 @@ +# Root logger option +log4j.rootLogger=INFO, stdout + +# Direct log messages to stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n From 8bc0ab6e231f06607efdafc6834cfd9f0e39f8de Mon Sep 17 00:00:00 2001 From: Bill Miller Date: Wed, 1 Nov 2017 19:22:01 -0400 Subject: [PATCH 4/4] Removing extraneous modules Removed URI and Processing modules since CORB task was removed. --- .../corb/redaction-rules-uris.xqy | 10 ---------- .../corb/validate-redaction-rules.xqy | 17 ----------------- 2 files changed, 27 deletions(-) delete mode 100644 examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy delete mode 100644 examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy diff --git a/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy b/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy deleted file mode 100644 index 3c5c7b325..000000000 --- a/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/redaction-rules-uris.xqy +++ /dev/null @@ -1,10 +0,0 @@ -xquery version "1.0-ml"; - -let $uris := - xdmp:invoke-function( - function() { cts:uris((), (), cts:directory-query("/redactionRules/")) }, - - {xdmp:database("redaction-project-schemas")} - ) - -return (count($uris), $uris) diff --git a/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy b/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy deleted file mode 100644 index 86c4a3f5d..000000000 --- a/examples/redaction-ruleset-project/src/main/ml-modules/ext/redaction-ruleset-validation/corb/validate-redaction-rules.xqy +++ /dev/null @@ -1,17 +0,0 @@ -xquery version "1.0-ml"; -import module namespace rdt = "http://marklogic.com/xdmp/redaction" at "/MarkLogic/redaction.xqy"; - - -declare variable $URI external; - -let $collections := - xdmp:invoke-function( - function() { xdmp:document-get-collections($URI) }, - - {xdmp:database("redaction-project-schemas")} - ) - - -return rdt:rule-validate(($collections)) - -