如何显示所选审阅者的所有属性? [英] How to display all the properties of the selected reviewers?

查看:122
本文介绍了如何显示所选审阅者的所有属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑业务流程审阅并批准(一个或多个审阅者)-将审阅任务分配给多个审阅者。



何时我



希望这对您有所帮助。


Consider the business process "Review and Approve (one or more reviewers) - Assign a review task to multiple reviewers".

When I choose reviewers I see only their properties cm:userName. How to display all the properties of the type cm:person?

For example:

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

And so on...

Instead of this container (part of the association.ftl):

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

I would like to use table. IMHO for that I should override some parts of the Alfresco.ObjectFinder, such as:

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

...etc. But how to display all the properties of the selected reviewers?

Let's say, this part:

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

I assume that it's property is name

Ok, then where to find the mapping "property in object-finder : property in the person type"?

解决方案

To display the companyname, email etc fields to you need to modify the following files in the repo side.

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

In the pickerresults.lib.js, I added the required extra properties in the CreatePersonResult(node) method.

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;
}

In the pickerresults.lib.ftl, I added the extra properties to the result set, below to the "selectable" : ${row.selectable?string}</#if>

"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!""}"

Hope this helps you now.

这篇关于如何显示所选审阅者的所有属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆