【问题标题】:How to display all the properties of the selected reviewers?如何显示所选评论者的所有属性?
【发布时间】:2019-09-28 19:39:02
【问题描述】:

考虑业务流程“审查和批准(一个或多个审查者) - 将审查任务分配给多个审查者”

当我choose 审阅者时,我只看到他们的属性cm:userName。如何显示cm:person类型的所有属性?

例如:

cm:userName
cm:firstName
cm:middleName
cm:email
cm:organizationId
cm:jobtitle
cm:googleusername

等等……

代替这个容器(association.ftl的一部分):

...
<div id="${controlId}-currentValueDisplay" class="current-values"></div> 
...

我想用桌子。恕我直言,我应该覆盖 Alfresco.ObjectFinder,如:

if (this.options.displayMode == "items")
{
   Dom.get(this.id + "-currentValueDisplay").innerHTML = displayValue;
}

...等等。但是如何显示所选评论者的所有属性

让我们说,这部分:

displayValue += 
    this.options.objectRenderer.renderItem(
        item, 
        16, 
        "<div class='itemtype-" + $html(item.type) + 
        "' style='word-wrap: break-word;'>{icon} {name}</div>"
    );

我假设它的属性是name

好的,那么在哪里可以找到映射"property in object-finder : property in the person type"

【问题讨论】:

    标签: alfresco alfresco-share alfresco-webscripts


    【解决方案1】:

    要向您显示公司名称、电子邮件等字段,您需要在 repo 端修改以下文件。

    C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\templates\webscripts\org\alfresco\repository\forms\pickerresults.lib.js
    
    C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\templates\webscripts\org\alfresco\repository\forms\pickerresults.lib.ftl
    

    在 pickerresults.lib.js 中,我在 CreatePersonResult(node) 方法中添加了所需的额外属性。

    function createPersonResult(node)
    {
       var personObject = 
       {
          typeShort: node.typeShort,
          isContainer: false,
          properties: {},
          displayPath: node.displayPath,
          nodeRef: "" + node.nodeRef
       }
    
       // define properties for person
       personObject.properties.userName = node.properties.userName;
       personObject.properties.name = (node.properties.firstName ? node.properties.firstName + " " : "") + 
          (node.properties.lastName ? node.properties.lastName : "") +
             " (" + node.properties.userName + ")";
       personObject.properties.jobtitle = (node.properties.jobtitle ? node.properties.jobtitle  : "");
       //Add the extra properties here
       personObject.properties.organization =(node.properties.organization ? node.properties.organization  : "");
       personObject.properties.googleusername =(node.properties.googleusername ? node.properties.googleusername  : "");   
    
       return personObject;
    }
    

    在pickerresults.lib.ftl 中,我将额外的属性添加到了结果集中,下面是"selectable" : ${row.selectable?string}&lt;/#if&gt;

    "nodeRef": "${row.item.nodeRef}"<#if row.selectable?exists>,
    "selectable" : ${row.selectable?string}</#if>,
    "company": "${row.item.properties.organization!""}",
    "googleusername": "${row.item.properties.googleusername!""}",
    "jobtitle": "${row.item.properties.jobtitle!""}"
    

    希望现在对您有所帮助。

    【讨论】:

    • 我使用的是企业版 (5.0.x)。您应该能够从 alfresco-remote-api-5.X.jar 文件中找到源文件。
    【解决方案2】:

    Object-finder.js 用于不同类型的对象,如人、标签等。

    item.typecm:person,但这里没有 person 对象的所有 person。参考下图。

    【讨论】:

    • 你能给我网页脚本的网址吗?我会尽快检查并让您知道可能性。
    猜你喜欢
    • 2016-01-22
    • 2019-04-12
    • 2017-01-13
    • 2021-10-28
    • 2020-02-18
    • 2013-02-23
    • 2016-11-04
    • 1970-01-01
    • 2011-05-03
    相关资源
    最近更新 更多