我正在使用Alfresco 5.0.d并希望修改下面屏幕截图中的列表。
到目前为止,我得到了workflow.lib.js文件,该文件具有获取工作流类型的getWorkflowDefinitions()方法,但我无法调试值来理解该方法。
我尝试使用logger.log来查看值但没有任何结果。
有什么想法吗?
答案 0 :(得分:0)
要启用JavaScript调试/ infor日志,请检查this answer:
logger.log使用类别
org.alfresco.repo.jscript.ScriptLogger
在级别调试,所以你在custom-log4j.properties中所拥有的是正确的 (但是appender被忽略了)。确保它位于类路径中 露天/扩展。目录tomcat/shared/classes/alfresco/extension
是您通常想要的。
更新:
答案 1 :(得分:0)
您还需要在share-config或share-config-custom.xml文件中启用客户端调试程序。
<flags>
<!--
Developer debugging setting to turn on DEBUG mode for client scripts in the browser
-->
<client-debug>false</client-debug>
<!--
LOGGING can always be toggled at runtime when in DEBUG mode (Ctrl, Ctrl, Shift, Shift).
This flag automatically activates logging on page load.
-->
<client-debug-autologging>false</client-debug-autologging>
<!--
When this is set to true any Aikau based errors will be posted back to the server and
captured by the server side logging. This can be useful to detect when errors occur in
a users browser -->
<post-client-debug>false</post-client-debug>
</flags>
getWorkflowDefinitions()
方法通过排除隐藏的工作流来返回实例中运行的所有工作流。这些隐藏的工作流列表发送到repo以忽略它们。
您可以在share-config.xml文件中看到隐藏的工作流程详细信息。
我在下面的功能中添加了内联注释。
function getWorkflowDefinitions()
{
// Get the hidden workflow list from Share-config or share-config-custom.xml
var hiddenWorkflowNames = getHiddenWorkflowNames(),
connector = remote.connect("alfresco"), //create connection to Alfresco repository
//Get request to repo and telling repo ignore some of the workflows also
result = connector.get("/api/workflow-definitions?exclude=" + hiddenWorkflowNames.join(","));
if (result.status == 200)
{
var workflows = JSON.parse(result).data;
//Sort the workflows based on their title
workflows.sort(sortByTitle);
return workflows;
}
//If there are not workflows, just return empty list to the client.
return [];
}
<!-- A list of workflow definitions that are NOT displayed in Share -->
<hidden-workflows>
<!-- Hide all WCM related workflows -->
<workflow name="jbpm$wcmwf:*"/>
<workflow name="jbpm$wf:articleapproval"/>
<!-- Hide publishing workflows -->
<workflow name="activiti$publishWebContent"/>
<workflow name="jbpm$publishWebContent"/>
<!-- Hide invitation workflows -->
<workflow name="jbpm$inwf:invitation-nominated"/>
<workflow name="jbpm$imwf:invitation-moderated"/>
<workflow name="activiti$activitiInvitationModerated"/>
<workflow name="activiti$activitiInvitationNominated"/>
</hidden-workflows>
如果您需要任何帮助,请告诉我。