Skip to content
rjrudin edited this page Jun 16, 2015 · 19 revisions

Automatically load new/modified modules

"gradle mlWatch" - invokes the WatchTask.

This runs an infinite loop, checking every second for modifications in the application's set of module paths. This is a useful task to run when you're developing modules and you only want to load what you've created/modified, and you don't want to have to run a command after every change to load your modules.

See How modules are loaded for information on how modules are actually loaded.

Note that this does not yet account for deleted modules - i.e. it won't delete the corresponding module from the modules database.

Clearing the content database

Call "gradle mlClearContentDatabase" (or usually "gradle mlclearcon") to delete all documents in your content database. You must include the property -PdeleteAll=true. This property is required to decrease the chance that you run this task accidentally.

Clearing the modules database

gradle mlClearModules

Invokes the ClearModulesTask for clearing out all or most of the modules in a modules database. Useful for when you need to do a fresh load of modules because some of the ones in the modules database may have been deleted from your project.

This task depends on mlDeleteModuleTimestampsFile, as it's almost always the case that when you clear all the modules, you also want to delete the properties file that keeps track of when modules were last loaded.

Create a new resource

You can easily create - i.e. stub out - a new REST API resource (or "service") via the following command:

gradle mlCreateResource -PresourceName=sample

The resourceName project property is required; it is used to name the resource file and its namespace. The following files will be created in your project:

  1. src/main/xqy/services/sample.xqy
  2. src/main/xqy/services/metadata/sample.xml

The metadata file is used to provide metadata to the REST API when your resource is installed. You can customize this as you wish.

Create a new transform

You can easily create - i.e. stub out - a new REST API transform via the following command:

gradle mlCreateTransform -PtransformName=sample -PtransformType=xsl

where transformType defaults to "xqy" and can be either "xqy" or "xsl".

This will create the following file in your project:

  1. src/main/xqy/transforms/sample.xqy
Clone this wiki locally