
flexrep.domainAlertingUri( domain-id as (Number|String) ) as String
Generate an alerting URI for a CPF domain. The URI will be a subdirectory of the directory used to store other state for the FlexRep domain. There is no requirement that the alerting configuration that a FlexRep domain be stored in this location, but it is a convenient place to put it.
| Parameters | |
|---|---|
| domain-id | The CPF domain ID. |
const flexrep = require('/MarkLogic/flexrep');
declareUpdate();
// Obtain the domain ID from the database used by the Master to enable CPF.
const domain = xdmp.eval(
'const dom = require("/MarkLogic/cpf/domains");' +
'fn.data(dom.get("Default Master").xpath("//dom:domain-id"));',
null,
{
'database' : xdmp.database('Triggers')
});
const cfg = flexrep.configurationCreate(domain);
const domainId = flexrep.configurationGetId(cfg);
flexrep.configurationInsert(
flexrep.configurationSetAlertingUri(cfg,
flexrep.domainAlertingUri(domainId)));
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.