2017-02-25 54 views
0

使用Alfresco Community 5.0.d並且無法從節點獲取組織。無法在戶外獲取組織表單節點

文件:pickerresults.lib.js 方法:createPersonResult(節點)

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在那裏,但沒有在這裏工作。

謝謝。

回答

1

請嘗試在

node.properties.["cm:organization"]

想獲得無需額外"."性質:

node.properties["cm:organization"] 

請參閱此文檔的鏈接 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); 
+0

我解決了這個問題,但我不能覆蓋pickerresults.lib.js文件。我更新了我的查詢。請看看它。 – nikhil84