3

我们正在迁移到 Alfresco 内容管理系统,并且没有用于检索自定义元数据的直接文档。

有没有办法获取我添加到 Alfresco Records Management File 计划中的 Record 类别的自定义元数据/自定义属性?自定义元数据基本上是扫描文档中的数据字段,如姓名、出生日期、表单 ID 等。

例如:我创建了 RM 站点并添加了以下文件计划。

TestCategory
|
--TestFolder1
  |
  --Record1
  --Record2
|
--TestFolder2
  |
  --Record1
  --Record2

这些记录包含上传的表格(扫描文档)以及元数据(自定义)。

要检索元数据,我正在使用

http://127.0.0.1:8090/alfresco/service/api/metadata/node/workspace/SpacesStore/ed6e2cc6-6dc5-4bfb-bf9d-b450f68863dd?alf_ticket=TICKET_06265902898618fe5a46e67992e07a9d4b72701a

它返回 405-Method not allowed (GET not supported)。

要检索文件夹中的所有子文件夹/文档,请使用 m

http://127.0.0.1:8090/alfresco/service/slingshot/doclib/doclist/documents/site/rm/documentLibrary/TestCat1/TestFolder2

以上一回

{
  "totalRecords": 1,
  "startIndex": 0,
  "metadata": {
    "repositoryId": "3b9d4f67-dc84-4531-b8b2-4dbcef15e25a",
    "container": "workspace://SpacesStore/7d1349bb-5289-4709-9055-c75c03ab5481",
    "parent": {
      "nodeRef": "workspace://SpacesStore/5d40660e-64d9-4bc4-a75e-ae4ae8b2201a",
      "permissions": {
        "userAccess": {
          "create": true,
          "edit": true,
          "delete": true,
          "cancel-checkout": false,
          "permissions": true
        }
      }
    },
    "onlineEditing": true,
    "itemCounts": {
      "folders": 0,
      "documents": 1
    }
  },
  "items": [
    {
      "nodeRef": "workspace://SpacesStore/65b9b52b-3418-4a85-98b0-d4770cf9399d",
      "nodeType": "cm:content",
      "type": "document",
      "mimetype": "application/pdf",
      "isFolder": false,
      "isLink": false,
      "fileName": "BO (2016-1464237424392).pdf",
      "displayName": "BO (2016-1464237424392).pdf",
      "status": "",
      "title": "þÿ",
      "description": "test description",
      "author": "",
      "createdOn": "2016-05-26T00:37:04.350-04:00",
      "createdBy": "Administrator",
      "createdByUser": "admin",
      "modifiedOn": "2016-05-31T15:50:21.269-04:00",
      "modifiedBy": "Administrator",
      "modifiedByUser": "admin",
      "lastThumbnailModification": "doclib:1464237426243",
      "lockedBy": "",
      "lockedByUser": "",
      "size": "156702",
      "version": "1.0",
      "contentUrl": "api/node/content/workspace/SpacesStore/65b9b52b-3418-4a85-98b0-d4770cf9399d/BO%20(2016-1464237424392).pdf",
      "webdavUrl": "/webdav/Sites/rm/documentLibrary/TestCat1/TestFolder2/BO%20(2016-1464237424392).pdf",
      "actionSet": "document",
      "tags": [],
      "activeWorkflows": "",
      "isFavourite": false,
      "likes": {
        "isLiked": false,
        "totalLikes": 0
      },
      "location": {
        "repositoryId": "3b9d4f67-dc84-4531-b8b2-4dbcef15e25a",
        "site": "rm",
        "siteTitle": "Records Management",
        "container": "documentLibrary",
        "path": "/TestCat1/TestFolder2",
        "file": "BO (2016-1464237424392).pdf",
        "parent": {
          "nodeRef": "workspace://SpacesStore/5d40660e-64d9-4bc4-a75e-ae4ae8b2201a"
        }
      },
      "permissions": {
        "inherited": true,
        "roles": [
          "ALLOWED;ROLE_EXTENDED_READER;ReadRecords;INHERITED",
          "ALLOWED;GROUP_Administrator7d1349bb-5289-4709-9055-c75c03ab5481;Filing;INHERITED",
          "ALLOWED;ROLE_EXTENDED_WRITER;Filing;INHERITED"
        ],
        "userAccess": {
          "create": true,
          "edit": true,
          "delete": true,
          "cancel-checkout": false,
          "permissions": true
        }
      },
      "custom": {},
      "actionLabels": {}
    }
  ]
}

使用 PostMan chrome 应用程序测试 rest api。TIA。

另一种方法:我在 Alfresco 论坛中找到它:

 /alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/a2a6c249-    c55d-4d29-8692-3e9cb1f811a8  [GET service]
4

2 回答 2

3

这应该这样做。示例请求。

http://localhost:8080/alfresco/service/slingshot/doclib2/node/workspace/SpacesStore/f558838b-24fa-4ea3-bb2a-602c7b4cec41

试一试,它会返回您需要的一切,不仅是元数据,还包括方面。

于 2016-06-03T18:03:00.920 回答
0

如果您得到的响应对于像我这样的人来说是压倒性的,那么在 Lista 给出的接受的(很好的)答案/解决方案中,这是一种更简单的方法:

HTTP 获取:

http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb

需要更多细节吗?试试这个:

http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb?include=association,path,permissions

你会得到类似这样的响应:

{"entry":{"isFile":true,"createdByUser":{"id":"admin","displayName":"Administrator"},"modifiedAt":"2020-12-16T00:01:56.615+0000","nodeType":"cm:content","content":{"mimeType":"application/pdf","mimeTypeName":"Adobe PDF Document","sizeInBytes":8037,"encoding":"UTF-8"},"parentId":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","aspectNames":["cm:versionable","cm:titled","cm:auditable","cm:taggable","cm:author"],"createdAt":"2020-12-13T16:48:27.600+0000","isFolder":false,"modifiedByUser":{"id":"admin","displayName":"Administrator"},"name":"fileName","id":"dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb","properties":{"cm:title":"titletest","cm:versionType":"MAJOR","cm:versionLabel":"1.0","cm:description":"descriptiontest"}}}

并且使用包含选项,响应将类似于此 -

{"entry":{"isFile":true,"createdByUser":{"id":"admin","displayName":"Administrator"},"modifiedAt":"2020-12-16T00:01:56.615+0000","association":{"isPrimary":true,"assocType":"cm:contains"},"nodeType":"cm:content","content":{"mimeType":"application/pdf","mimeTypeName":"Adobe PDF Document","sizeInBytes":8037,"encoding":"UTF-8"},"parentId":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","aspectNames":["cm:versionable","cm:titled","cm:auditable","cm:taggable","cm:author"],"createdAt":"2020-12-13T16:48:27.600+0000","path":{"name":"/Company Home/Sites/site1/documentLibrary/Employee/Test","isComplete":true,"elements":[{"id":"3ac0f350-a3e0-4da4-8dfa-c8e74553b024","name":"Company Home","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable","app:uifacets"]},{"id":"15d878c2-e880-4a3f-ac00-60596ba2dcd1","name":"Sites","nodeType":"st:sites","aspectNames":["cm:titled","cm:auditable","app:uifacets"]},{"id":"46c2a6b1-2839-4b25-ac5d-c7dd874aea1e","name":"site1","nodeType":"st:site","aspectNames":["cm:tagscope","cm:titled","cm:auditable"]},{"id":"e8bc3bfe-7b41-416e-aa6a-9ee1b4fc9779","name":"documentLibrary","nodeType":"cm:folder","aspectNames":["cm:tagscope","st:siteContainer","cm:ownable","cm:titled","cm:auditable"]},{"id":"d5027ba7-874c-4996-bcde-923c68ec4c5b","name":"Employee","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable"]},{"id":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","name":"Test","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable"]}]},"isFolder":false,"permissions":{"inherited":[{"authorityId":"GROUP_EVERYONE","name":"SiteConsumer","accessStatus":"ALLOWED"},{"authorityId":"GROUP_EVERYONE","name":"ReadPermissions","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteConsumer","name":"SiteConsumer","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteManager","name":"SiteManager","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteCollaborator","name":"SiteCollaborator","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteContributor","name":"SiteContributor","accessStatus":"ALLOWED"}],"settable":["Contributor","Collaborator","Coordinator","Editor","Consumer"],"isInheritanceEnabled":true},"modifiedByUser":{"id":"admin","displayName":"Administrator"},"name":"fileName","id":"dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb","properties":{"cm:title":"titletest","cm:versionType":"MAJOR","cm:versionLabel":"1.0","cm:description":"descriptiontest"}}}

免责声明:我使用的是 Alfresco 6.2 社区版。但根据文档(公共 rest-api 链接),它说:

注意:此端点在 Alfresco 5.2 和更新版本中可用。

于 2020-12-16T00:20:56.313 回答