Dixit Singla
Dixit Singla

Reputation: 2620

Is it possible to import other xquery modules in marklogic CPF action module?

I am using MarkLogic CPF framework.

When a document is inserted in a particular collection a XQuery module will be invoked let's say create-doc.xqy.

I have configured the domain to have all the xquery modules in documents database under path /create/xquery/modules/*.xqy

Path for create-doc.xqy will be /create/xquery/modules/create-doc.xqy

Is it possible to import other xquery modules in create-doc.xqy and use it's methods?

Upvotes: 0

Views: 102

Answers (2)

Anuj Kumar
Anuj Kumar

Reputation: 33

There are two approaches to doing this

  1. Just insert your xqy file in the MarkLogic Database on which the CPF is defined(not modules DB) and now you can refer it from the CPF actions.
  2. The second method is to put the module in the "Modules" directory in MarkLogic installation folder. Now you can refer it from the CPF action same as you import search module to use "search:search" method.

Upvotes: 1

From your description, it appears that the chapter related to importing modules is what you are looking for:

https://docs.marklogic.com/guide/app-dev/import_modules

Upvotes: 3

Related Questions