This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
batch = DocumentBatch() | |
# Document with every type of metadata supplied | |
batch.add( | |
Document( | |
uri="/example1.json", | |
content={"some": "data"}, | |
content_type="application/json", | |
metadata=Metadata( | |
quality=1.2, | |
collections=["coll1", "coll2"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In addition to what's in this file, you'll need to define the following properties in your | |
// gradle.properties file: | |
// | |
// mavenCentralUsername= | |
// mavenCentralPassword= | |
// mavenCentralUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ | |
// | |
// In order for the "signing" plugin to work correctly, you'll also need to define the following properties, either | |
// in your gradle.properties file or at runtime: | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The below tasks are used for deploying and undeploying test resources for a DHF 5 application. Just copy everything below | |
* this comment into the build.gradle file in your DHF application - no properties need to be set for these tasks to work. | |
* | |
* The task "hubDeployTestResources" will deploy test versions of your staging and final databases and app servers. You | |
* can customize these tasks if you don't like the resource names and ports that are used by them. Note that mlDeploy | |
* does not depend on this task by default - you'll need to invoke it in order to create test resources. | |
* | |
* The task "hubUndeployTestResources" will undeploy any test resources that were created. mlUndeploy does depend on | |
* this task as there's typically no downside to undeploying these resources - if they don't exist, the task will |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste everything below this comment block into the bottom of the build.gradle file in your DHF project. | |
// Read the comments to see how this works and what properties you'll need to define. | |
// Note - this works on DHF 4.1 projects. See https://gist.github.com/rjrudin/ce347cd657b3768332c17641fdb12907 for | |
// DHF 3 and 4.0.x projects. | |
/** | |
* Tasks for setting up a test database and a test app server that mirror either your final or staging database and | |
* app server, and then loading hub and user modules via the test app server so that REST options are accessible to it. | |
* Depends on the following properties being set: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare function permission-query($role, $capability) | |
{ | |
cts:term-query( | |
xdmp:add64( | |
xdmp:mul64(xdmp:add64(xdmp:mul64(xdmp:role($role), 5), xdmp:hash64($capability)), 5), | |
xdmp:hash64("permission()") | |
) | |
) | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste everything below this comment block into the bottom of the build.gradle file in your DHF project. | |
// Read the comments to see how this works and what properties you'll need to define. | |
// Note - this only works on DHF 3 projects, and it should work as well on 4.0.x projects. | |
// For 4.1 projects, see https://gist.github.com/rjrudin/df0ff09f5bff67833048e67f1ebaa5d6 | |
/** | |
* Tasks for setting up a test database and a test app server that mirror either your final or staging database and | |
* app server, and then loading hub and user modules via the test app server so that REST options are accessible to it. | |
* Depends on the following properties being set: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task camelRun(type: JavaExec) { | |
main = 'org.apache.camel.spring.Main' | |
classpath = sourceSets.main.runtimeClasspath | |
systemProperties = [ | |
"fileUri": fileUri, | |
"mlcpUri": mlcpUri | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileUri=file://inbox | |
mlcpUri=mlcp:localhost:8003?username=admin&password=admin&output_collections=sample-collection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> | |
<!-- The URIs are expected to be system properties, which are configured via the Gradle "camelRun" task --> | |
<route> | |
<from uri="{{fileUri}}" /> | |
<to uri="{{mlcpUri}}" /> | |
</route> | |
</camelContext> |