首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何设置CORB

如何设置CORB
EN

Stack Overflow用户
提问于 2017-08-08 23:08:28
回答 1查看 317关注 0票数 1

如何构造这个XQuery以在CORB作业中运行?使用匹配的候选URI处理每个文档的第二个模块不起作用。

URIS模块

代码语言:javascript
复制
(:a module to select the candidate URIs to process:)
xquery version "1.0-ml";
declare variable $target-collection := "/activity";  
declare variable $update-collection := "/activity/analytics-read-added"

let $uris := cts:uris( (),
                       (),
                       cts:and-query((          
                           cts:collection-query($target-collection),
                           cts:not-query(cts:collection-query($update-collection))
                        ))
)
return (count($uris), $uris)

工艺模块

代码语言:javascript
复制
(:a module to process each doc with a matching candidate URI:)
declare variable $URI as xs:string external;

 xdmp:document-add-permission($URI,xdmp:permission("act-read-role","read")),

xdmp:document-add-collections($URI,$update-collection)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-09 00:25:44

您的流程模块有几个小问题:

  • 如果要使用URIS模块中声明的变量$update-collection,也需要在Process中声明它。
  • 要添加权限的函数拼写错误。它是复数:xdmp:document-add-permissions()

将这些更改应用于流程模块:

代码语言:javascript
复制
xquery version "1.0-ml";
(:a module to process each doc with a matching candidate URI:)
declare variable $URI as xs:string external;
declare variable $update-collection := "/activity/analytics-read-added";

 xdmp:document-add-permissions($URI, xdmp:permission("act-read-role","read")),
 xdmp:document-add-collections($URI, $update-collection)

如果您需要排除故障并调查流程模块不工作的原因,有时最容易的方法是将Process的内容粘贴到查询控制台,为$URI变量分配一个值,然后在QConsole中执行。

例如:

代码语言:javascript
复制
declare variable $URI as xs:string external := "/some/test/doc.xml";
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45579309

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档