Skip to content

Other Properties

Mads Hansen edited this page Jun 21, 2017 · 6 revisions

Cross-task Properties

Some properties are not restricted for use by any one specific task. For instance, connection information to the server will be used by all tasks. This section will cover properties that can be used across tasks.

As mentioned, the database connection information is contained in properties. It can either be passed entirely as a connection URI or it can be broken up into multiple parts if the connection URI isn’t provided. Often it's necessary to encrypt connection information, which will be covered later.

  • XCC-CONNECTION-URI=theEntireConnectionString
  • XCC-USERNAME (Required if XCC-CONNECTION-URI is not specified)
  • XCC-PASSWORD (Required if XCC-CONNECTION-URI is not specified)
  • XCC-HOSTNAME (Required if XCC-CONNECTION-URI is not specified)
  • XCC-PORT (Required if XCC-CONNECTION-URI is not specified)
  • XCC-DBNAME (Optional)
  • XCC-CONNECTION-RETRY-LIMIT (Number attempts to connect to ML before giving up - default is 3)
  • XCC-CONNECTION-RETRY-INTERVAL (in seconds - Time interval in seconds between retry attempts - default is 60)

Prior to CORB 2.1.0, if an XQuery module was going to be used it had to be preloaded into the database at the URI specified by the PRE-BATCH, PROCESS or POST-BATCH module property. Now it is no longer necessary to load the modules to the database. Instead they can be read from a file or INLINE ADHOC module into memory and then discarded when the task is complete. To make use of this 'ad hoc' functionality simply append the string "|ADHOC" onto the end of the URI for the module and ensure the file is on the Java classpath. For example:

POST-BATCH-MODULE=/path/to/postBatch.xqy|ADHOC

If using a database to store the modules, use the following property to specify which database the modules reside in:

  • MODULES-DATABASE (Use 0 if on file system; uses the XCC-CONNECTION-URI if not provided)

If the URIs for modules are long, it may be desirable to use a property to set a base path for the URIs to avoid repeating the same base path for each module. If so use:

MODULE-ROOT=/some/really/long/base/path/
URIS-MODULE=uris.xqy
PROCESS-MODULE=process.xqy

Custom Properties

Sometimes it's desirable to pass in values to an XQuery script. For instance, if a search needs to be performed over a range of dates but the range may change in the future it would be best to put the dates in a properties file so that they could be changed easily. Since CORB 2.1.0, all modules support the use of custom properties. To use a custom property, it must be prepended with the Task name and declared as an external variable in the XQuery. For instance, to pass in start date and end date values to the URIS Task module with external variables named $startDate and $endDate` use:

URIS-MODULE.startDate=20150317
URIS-MODULE.endDate=20150331

To pass a collection name to the PROCESS task use:

PROCESS-MODULE.collectionName=nameOfCollectionToUse

Custom properties are supported for the following modules:

  • URIS-MODULE
  • PROCESS-MODULE
  • PRE-BATCH-MODULE
  • POST-BATCH-MODULE
  • INIT-MODULE