new Modules(domain)
Parameters:
| Name | Type | Description |
|---|---|---|
domain |
string | The project domain |
- Source:
Methods
-
createModule(module-path, token, module-body, compile, Content-Type)
-
This method creates a new project module. If the
compileoption isnone, the module will not be compiled, if it islaxit will be compiled and any potential compilation error reported. In this case, compilation errors will not prevent the module to be created. To only create the module if no compilation errors are present, set thecompileoption tostrict. The default islax.It is not allowed to create a project module with the same path of an existing system or project module. If the operation succeeds any precompiled query depending on the updated module will be deleted.
Parameters:
Name Type Description module-pathstring The module path., tokenstring A project token., module-bodystring The source code of the module., compilestring The kind of compilation to perform. The default is lax., Content-Typestring , - Source:
-
getModule(module-path, token)
-
This method retrieves the source code of a project module. The response content type is set according to the query language of the module. If the query does not declare its own dialect or cannot be parsed, the query language is considered to be
XQuery.This operation cannot be used to retrieve the source code of system modules.
Parameters:
Name Type Description module-pathstring The module path., tokenstring A project token., - Source:
-
listModules(starts-with, include-system, include-ns, include-src, token)
-
This method retrieves the list of modules which can be imported by a project.
By default, only modules defined in the project will be listed. To also list system-provided modules, you can set the
include-systemquery parameter totrue.To include module namespaces or source codes, you can set the
include-nsorinclude-srcquery parameters totrue. Regardless of the value of theinclude-srcparameter, the source code of system modules will not be returned.To filter the returned modules you can use the
starts-withquery parameter. In this case, only the modules which path starts with the specified string will be returned.If two or more module have the same namespace and thus the same path, the details of the module which would be imported by a query are shown.
Parameters:
Name Type Description starts-withstring Filter the available module by their module path., include-systemboolean Include modules provided by the platform., include-nsboolean Include each module's namespace in the listing., include-srcboolean Include each module's source code in the listing., tokenstring A project token., - Source:
-
removeModule(module-path, token)
-
This method removes the specified project module. If the operation succeeds any precompiled query depending on the updated module will be deleted.
Parameters:
Name Type Description module-pathstring The module path., tokenstring A project token., - Source:
-
saveModule(module-path, token, module-body, compile)
-
This method creates or updates a project module. If the
compileoption isnone, the module will not be compiled, if it islaxit will be compiled and any potential compilation error reported. In this case, compilation errors will not prevent the module to be created or updated. To only create the module if no compilation errors are present, set thecompileoption tostrict. The default islax.It is not allowed to update system modules. If the operation succeeds any precompiled query depending on the updated module will be deleted.
Parameters:
Name Type Description module-pathstring The module path., tokenstring A project token., module-bodystring The module source code, compilestring The kind of compilation to perform. The default is lax., - Source: