无法在露天获取组织形式节点

Not able to get organization form node in alfresco

使用 Alfresco 社区 5。0.d 并且无法从节点获取组织。

文件: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;

   // defining new property for the personObject but
   // but not getting any value
   personObject.properties.companyname = (node.properties["cm:organization"] ? node.properties["cm:organization"]  : "");
      personObject.properties.companyname = (node.properties.organization ? node.properties.organization : "");

   return personObject;
}

通过将 pickerresults.lib.js 文件复制到以下位置来覆盖它。

/Applications/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension/templates/webscripts/org/alfresco/repository/forms/pickerresults.lib.js

如何获得组织名称? 还有我怎么能调试像 logger.log 这样的节点属性,但在这里不起作用。

谢谢。

请尝试在

中获取没有额外"."的属性

node.properties.["cm:organization"]

喜欢:

node.properties["cm:organization"]

请参考此文档link http://docs.alfresco.com/4.0/references/API-JS-ScriptNode.html

属性

提供对该节点所有属性的访问。返回的属性通过关联数组访问。可以通过以下方式访问节点的属性:

示例:node.properties["name"]

示例:node.properties.name

我试过的例子:

var node =people.getPerson("admin");
logger.log(node.properties["cm:email"]);
logger.log(node.properties.email);