我对 Alfresco 有特殊需求,不幸的是我是刚使用该产品的新手。
实际上,我的目的是在工作流程中仅显示协调者是登录用户且不在 Activity 工作流程中的文档。
有什么想法请:)
最佳答案
我带着一个解决方案回来了,即使我不确定它是否是最好的。任何解决我的问题的方法。
我修改了 object-finder.js 的 ObjectRenderer_renderCellAdd 方法来检查用户是否是文档协调员以及是否没有其他 Activity 工作流程链接到该文档。
而不是:
elCell.innerHTML = '<a id="' + containerId + '" href="#" ' + style + ' class="add-item add-' + scope.eventGroup + '" title="' + scope.msg("form.control.object-picker.add-item") + '" tabindex="0"><span class="addIcon"> </span></a>';
我输入:
var showSelectLink = true;
if(oRecord.getData("type") == "cm:content"){
showSelectLink = false;
//Checking if the document is already in an other active worflow
var xmlHttp = new XMLHttpRequest();
var url = window.location.href;
var arr = url.split("/");
xmlHttp.open( "GET", (arr[0] + "//" + arr[2]).concat("/alfresco/s/api/node/").concat((oRecord.getData("nodeRef")).replace(":/","")).concat("/workflow-instances"), false );
xmlHttp.send( null );
if(json.data.length == 0){
//Checking if the logged on user is the document coordinator
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", (arr[0] + "//" + arr[2]).concat("/alfresco/s/slingshot/doclib/permissions/").concat((oRecord.getData("nodeRef")).replace(":/","")), false );
xmlHttp.send( null );
var json = JSON.parse(xmlHttp.responseText);
var hasDirectPermission = false;
//Direct permission
if(json.direct.length != 0){
var permission;
for(var index = 0; index < json.direct.length; index++){
permission = json.direct[index];
if(permission.role == "Coordinator"){
showSelectLink = true;
hasDirectPermission = true;
break;
}
}
}
//Inherited Permission
if(!hasDirectPermission && json.inherited.length != 0){
var permission;
for(var index = 0; index < json.inherited.length; index++){
permission = json.inherited[index];
if(permission.role == "Coordinator"){
showSelectLink = true;
break;
}
}
}
}
}
if(showSelectLink){
elCell.innerHTML = '<a id="' + containerId + '" href="#" ' + style + ' class="add-item add-' + scope.eventGroup + '" title="' + scope.msg("form.control.object-picker.add-item") + '" tabindex="0"><span class="addIcon"> </span></a>';
}
问候,
关于java - 露天 : How to filter documents in workflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28932706/