简体   繁体   English

如何获取Alfresco工作流程的内容?

[英]How to retrieve a content of Alfresco workflow?

I have a workflow where I have audio content. 我有一个工作流程,其中有音频内容。 I need to access for this content in other application (with javascript). 我需要在其他应用程序(使用javascript)中访问此内容。 I am trying with a GET method to this URL: 我正在尝试使用该URL的GET方法:

http://localhost:8086/alfresco/service/cmis/s/SpacesStore/i/1a7be6f8-0c50-4995-a211-1736642db06a/children?alf_ticket=TICKET_f9906d69befbc49668b92ddf372d62532a29ce7d http:// localhost:8086 / alfresco / service / cmis / s / SpacesStore / i / 1a7be6f8-0c50-4995-a211-1736642db06a / children?alf_ticket = TICKET_f9906d69befbc49668b92ddf372d62532a29ce7d

(In this URL, the id "1a7be6f8-0c50-4995-a211-1736642db06a" is the identificator of the package of the workflow task.) (在此URL中,标识“ 1a7be6f8-0c50-4995-a211-1736642db06a”是工作流任务包的标识。)

But, the response is the next XML: 但是,响应是下一个XML:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:alf="http://www.alfresco.org" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<author><name>admin</name></author>
<generator version="4.2.0 (r56674-b4848)">Alfresco (Community)</generator>
<icon>http://localhost:8086/alfresco/images/logo/AlfrescoLogo16.ico</icon>
<id>urn:uuid:1a7be6f8-0c50-4995-a211-1736642db06a-children</id>
<link rel="service" href="http://localhost:8086/alfresco/service/cmis"/>
<link rel="self" href="http://localhost:8086/alfresco/service/cmis/s/SpacesStore/i/1a7be6f8-0c50-4995-a211-1736642db06a/children?alf_ticket=TICKET_f9906d69befbc49668b92ddf372d62532a29ce7d"/>
<link rel="via" href="http://localhost:8086/alfresco/service/cmis/s/workspace:SpacesStore/i/1a7be6f8-0c50-4995-a211-1736642db06a"/>
<link rel="up" href="http://localhost:8086/alfresco/service/cmis/s/workspace:SpacesStore/i/13dd8d00-4ccd-4894-87fc-0b055cf41a4b/children" type="application/atom+xml;type=feed"/>
<link rel="down" href="http://localhost:8086/alfresco/service/cmis/s/workspace:SpacesStore/i/1a7be6f8-0c50-4995-a211-1736642db06a/descendants" type="application/cmistree+xml"/>
<link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://localhost:8086/alfresco/service/cmis/s/workspace:SpacesStore/i/1a7be6f8-0c50-4995-a211-1736642db06a/tree" type="application/atom+xml;type=feed"/>
<title>1a7be6f8-0c50-4995-a211-1736642db06a Children</title>
<updated>2015-05-27T11:18:13.600-04:00</updated>
<opensearch:totalResults>0</opensearch:totalResults>
<opensearch:startIndex>0</opensearch:startIndex>
<opensearch:itemsPerPage>-1</opensearch:itemsPerPage>
<cmisra:numItems>0</cmisra:numItems>
</feed>

I don't know how to use this XML for my purpose. 我不知道该如何使用此XML。 I need to hear the content (mp3 audio file) and modify its properties in my custom application. 我需要听到内容(mp3音频文件)并在我的自定义应用程序中修改其属性。

Also I am trying with the next URL (GET): 我也在尝试下一个URL(GET):

http://localhost:8086/alfresco/service/api/node/content/workspace/SpacesStore/1a7be6f8-0c50-4995-a211-1736642db06a http:// localhost:8086 / alfresco / service / api / node / content / workspace / SpacesStore / 1a7be6f8-0c50-4995-a211-1736642db06a

But the result is: Web Script Status 404 - Not Found 但是结果是: Web脚本状态404-找不到

How to retrieve a content of a workflow? 如何检索工作流的内容? There is some RESTful URL for this ? 是否有一些RESTful URL?

Thanks for any help. 谢谢你的帮助。

Greetings, Pablo. 问候,巴勃罗。

Finally, I resolve my questions using other RESTful URL. 最后,我使用其他RESTful URL解决了我的问题。 So, the steps to retrieve a content of a workflow is the next: 因此,下一步是检索工作流内容的步骤:

1. I get the package ID (this is a folder node) of the task of workflow: 1.获得工作流任务的程序包ID(这是一个文件夹节点):

GET /alfresco/service/api/task-instances/activiti$taskID GET / alfresco / service / api / task-instances / activiti $ taskID

{
   "data": 
      {
         "id": "activiti$taskID",
         "url": "api\/task-instances\/activiti$taskID",
         "name": "wf:taskName",
         "title": "Task for this",
         "description": "Hello World !",
         "state": "IN_PROGRESS",
         "path": "api\/workflow-paths\/activiti$workflowID",
         "isPooled": false,
         "isEditable": true,
         "isReassignable": true,
         "isClaimable": false,
         "isReleasable": false,
         "outcome": null,
         "owner":
         {
            "userName": "admin",
            "firstName": "Admin",
            "lastName": "istrator"
         },
         "properties":
         {
            "bpm_percentComplete": 0,
            "bpm_description": "Hello World !",
            "bpm_hiddenTransitions": [],
            "bpm_package":"workspace:\/\/SpacesStore\/1a7be6f8-0c50-4995-a211-1736642db06a",
       ...........................................................
}

So, the package ID is: 1a7be6f8-0c50-4995-a211-1736642db06a 因此,程序包ID为: 1a7be6f8-0c50-4995-a211-1736642db06a

2. With the package ID, I get the content which I need of this package: 2.使用程序包ID,可以获得该程序包所需的内容:

GET /alfresco/service/slingshot/node/workspace/SpacesStore/1a7be6f8-0c50-4995-a211-1736642db06a GET / alfresco / service / slingshot / node / workspace / SpacesStore / 1a7be6f8-0c50-4995-a211-1736642db06a

.............................................    
"children": [
      {
         "name": {
            "name": "{http:\/\/www.alfresco.org\/model\/content\/1.0}grabacion1.mp3",
            "prefixedName": "cm:grabacion1.mp3"
        },
         "nodeRef": "workspace://SpacesStore/9ed7905d-7017-40e9-9514-93244b0a9a6a",
         "type": {
            "name": "{http:\/\/www.alfresco.org\/model\/content\/1.0}content",
            "prefixedName": "cm:content"
        },
         "assocType": {
            "name": "{http:\/\/www.alfresco.org\/model\/bpm\/1.0}packageContains",
            "prefixedName": "bpm:packageContains"
        },
         "primary": false,
         "index": 0
      }
   ],
.............................................

So, the content ID is: 9ed7905d-7017-40e9-9514-93244b0a9a6a 因此,内容ID为: 9ed7905d-7017-40e9-9514-93244b0a9a6a

3. Finally, I get the content which I need: 3.最后,我得到了所需的内容:

GET /alfresco/service/api/node/content/workspace/SpacesStore/9ed7905d-7017-40e9-9514-93244b0a9a6a GET / alfresco / service / api / node / content / workspace / SpacesStore / 9ed7905d-7017-40e9-9514-93244b0a9a6a

If you need access to the properties of the content, you can use the URL of the step two with the content ID (in this example: 9ed7905d-7017-40e9-9514-93244b0a9a6a). 如果需要访问内容的属性,则可以将第二步的URL与内容ID一起使用(在此示例中:9ed7905d-7017-40e9-9514-93244b0a9a6a)。

Greetings :) 问候 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Alfresco中创建JavaScript工作流 - Create a javascript workflow in Alfresco 如何从 Alfresco 工作流程中对 REST ws 进行 API 调用? - How to make an API call to a REST ws from an Alfresco workflow? 如何通过Alfresco的Activiti工作流javascript获取bpm_outcome - How to get bpm_outcome by Activiti workflow javascript in Alfresco Alfresco:在工作流取消上运行Javascript - Alfresco: Run Javascript on Workflow Cancellation 更改文件内容 - Alfresco - Change content of file - Alfresco 如何在露天共享中批准工作流的审阅步骤之前添加确认对话框 - How to add a confirmation dialog before approving a review step of a workflow in alfresco share 如何从相关文档中获取工作流的状态? ,关于Alfresco的文件夹规则脚本 - How to get status of the workflow from related the document ? , About Folder Rule Script of Alfresco Alfresco社区版5.1.x如何使用Web脚本(Java或JavaScript)启动工作流程? - Alfresco community edition-5.1.x how can i start workflow using webscript (java or javascript)? 如何在Alfresco中创建规则以将内容从一个文件夹移动到另一个文件夹? - How to create a rule in Alfresco to move content one folder to another? 如何使用 .ftl 显示内容属性? 露天 - How can i display content atributes using .ftl? Alfresco
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM