json 来自 Alfresco 的多维数组

json multidimensional array from Alfresco

我正在尝试使用一个 Alfresco api,其中 return 是关于存储在特定 Alfresco 目录下的一些文档的信息。

我的问题是,在我得到的 Json 上,当我尝试 return 例如来自 cmis:name 的值时,我遇到了一个欠定义错误。

我设法达到了 "properties" 水平,但我无法再进一步了。你能告诉我吗?

提前致谢。

 success: function (json) {

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

你有没有这样查询过:

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

我找到了访问最后一个级别并获取值的正确方法:

success: function (json) {

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