gpt4 book ai didi

java - 通过后端 webscript 在 Alfresco 中获取节点详细信息

转载 作者:行者123 更新时间:2023-11-29 06:34:27 33 4
gpt4 key购买 nike

我想通过后端网络脚本获取节点详细信息,但我遇到了一些问题。我试过两个网络脚本:

  • alfresco/service/slingshot/doclib2/node/workspace/SpacesStore/a10a0777-40f4-42da-b236-8845eb26294e

  • alfresco/service/slingshot/doclib/node/workspace/SpacesStore/a10a0777-40f4-42da-b236-8845eb26294e

第一个给了我这个回复:

{
"status" :
{
"code" : 410,
"name" : "Gone",
"description" : "Resource is no longer available at the server and no forwarding address is known."
},

"message" : "Location is 'null'. (No permission?)",
"exception" : "",

"callstack" :
[

],

"server" : "Enterprise v4.2.0 (r57217-b28) schema 6,034",
"time" : "Jun 10, 2014 10:28:15 AM"
}

第二个:

{
"status" :
{
"code" : 500,
"name" : "Internal Error",
"description" : "An error inside the HTTP server which prevented it from fulfilling the request."
},

"message" : "05100028 Wrapped Exception (with status template): 05100077 Failed to execute script 'classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/node.get.js': 05100076 Site container UploadComponent.java does not refer to a folder.",
"exception" : "org.springframework.extensions.webscripts.WebScriptException - 05100028 Wrapped Exception (with status template): 05100077 Failed to execute script 'classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/node.get.js': 05100076 Site container UploadComponent.java does not refer to a folder.",

"callstack" :
[
"" ,"org.alfresco.repo.site.SiteServiceException: 05100076 Site container UploadComponent.java does not refer to a folder."
,"

更新:

您会注意到,在第二个 webSript 中,错误表明我的文件 UploadComponent.java 没有引用文件夹。此脚本是否将 cm:folder 作为参数。如果有另一个从 nodeRef 返回节点详细信息(属性:nodeRef、mimetype、大小...)的网络脚本,请向我展示。谢谢!

最佳答案

专业提示 - 您可以在 http://localhost:8080/alfresco/service/index/uri/

查看所有可用的网络脚本

应该尽可能使用 CMIS 网络脚本,这也是最简单的请求。

http://<MyAlfresco>/alfresco/service/cmis/i/8826b8f4-9f61-41a4-9f21-14ad5b6395ab

这将返回 nodeRef workspace://SpacesStore/8826b8f4-9f61-41a4-9f21-14ad5b6395ab 的完整属性集。

您将收到的一些 XML 是:

<cmis:properties>
<cmis:propertyInteger propertyDefinitionId="cmis:contentStreamLength" displayName="Content Stream Length" queryName="cmis:contentStreamLength"><cmis:value>36864</cmis:value></cmis:propertyInteger>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId" displayName="Object Type Id" queryName="cmis:objectTypeId"><cmis:value>cmis:document</cmis:value></cmis:propertyId>
<cmis:propertyString propertyDefinitionId="cmis:versionSeriesCheckedOutBy" displayName="Version Series Checked Out By" queryName="cmis:versionSeriesCheckedOutBy"/>
<cmis:propertyBoolean propertyDefinitionId="cmis:isPrivateWorkingCopy" displayName="Is private working copy" queryName="cmis:isPrivateWorkingCopy"/>
<cmis:propertyId propertyDefinitionId="cmis:versionSeriesCheckedOutId" displayName="Version Series Checked Out Id" queryName="cmis:versionSeriesCheckedOutId"/>
<cmis:propertyId propertyDefinitionId="cmis:versionSeriesId" displayName="Version series id" queryName="cmis:versionSeriesId"><cmis:value>workspace://SpacesStore/8826b8f4-9f61-41a4-9f21-14ad5b6395ab</cmis:value></cmis:propertyId>
<cmis:propertyBoolean propertyDefinitionId="cmis:isLatestVersion" displayName="Is Latest Version" queryName="cmis:isLatestVersion"><cmis:value>true</cmis:value></cmis:propertyBoolean>
</cmis:properties>

我还检查过,这应该为您提供任何节点的属性,无论它位于您的 Alfresco 实例中的哪个位置。

关于java - 通过后端 webscript 在 Alfresco 中获取节点详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24136467/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com