MarkLogic 8 - Corb pass arguments other than $ URI

So, I have a uris.xqy file that gets the URI of the document I want to use in corb .

Then I have docs.xqy which injects $ URI declare variable $URI as xs:string external;

And then I do some processing on this document.

Now I want to pass on the command line a parameter from the command line, so ./ml ${Environment} corb --uris=/uris.xqy --modules=/docs.xqy --hello=world

When I execute the above command, I will have access to hello and it will contain the world in docs.xqy .

+3


source to share


2 answers


I think you are looking for a custom property

PROCESS-MODULE.hello=world

      

The CORB2 wiki explains this at



https://github.com/marklogic/corb2/wiki/Other-Properties#custom-properties

To use a custom property, it must be added with the task name and declared as an external variable in XQuery.

To pass the name of the collection to the PROCESS task:

PROCESS-MODULE.collectionName=nameOfCollectionToUse

+3


source


As of Roxy v1.7.4 +, you can now specify any CoRB options to enable custom module inputs using switches --

or -D

.

If you are upgrading to Roxy 1.7.4.1 (or later), you can send this value to the docs.xqy external module variable named "hello" by doing the following:



./ml ${Environment} corb --uris=/uris.xqy --modules=/docs.xqy --PROCESS-MODULE.hello=world

      

0


source







All Articles