2017-09-18 47 views
0

我想要使用一個Alfresco API,它返回存儲在特定的Alfresco目錄下的一些文檔的信息。來自Alfresco的json多維數組

我的問題是,我正在得到的Json,當我試圖返回例如cmis:name的值我得到一個未定義的錯誤。

我設法達到「屬性」的水平,但我無法繼續前進。你能告訴我嗎?

預先感謝您。

success: function (json) { 

      $.each(json, function() { 
       $.each(this, function (key, value) { 
        console.log(value.object.properties); 
       }); 
       }); 
     }, 

enter image description here

回答

1

我發現進入最後一級的正確方法和得到值:

success: function (json) { 

      $.each(json, function() { 
       $.each(this, function (key, value) { 
        console.log(value.object.properties['cmis:name'].value); 
       }); 
       }); 
     }, 
0

沒有你這樣的查詢:

http://localhost:8080/alfresco/s/example/cmis/query?format=json&q=select%20cmis:name,cmis:objectId%20from%20cmis:document%20where%20cmis:name%20=%27testwhitepaper%27

那麼你將得到:

{"query": "select cmis:name,cmis:objectId from cmis:document where cmis:name ='testwhitepaper'", 
"results": [ 
{"name":"testwhitepaper", 
"id":"workspace://SpacesStore/9a007b6a-261a-4d6d-9e34-ded4430ba1ab;1.0" 
}, 
{"name":"testwhitepaper", 
"id":"workspace://SpacesStore/3356ff7d-4172-4bd5-a826-adfa541e6ad2;1.0" 
} 
] 
} 
+0

不,它是一個典型的ajax請求,我的網址是:url:'http://alfresco.companyname.com/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/網站/ ops-it/documentLibrary/Documentation/Intranet',我想獲得該文件夾中文檔名稱的列表 – Wizeman1986