【问题标题】:Mule ESB move file into Alfresco using CMIS connectorMule ESB 使用 CMIS 连接器将文件移动到 Alfresco
【发布时间】:2012-10-24 01:09:57
【问题描述】:

所以,我正在使用 Mule 来抓取放入文件夹中的文件,并且我想通过 CMIS 连接器将这些文件推送到 Alfresco。我已经启动并运行了 Alfresco,但在尝试移动文件时,Mule 中不断出现错误。以下是我的流程:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:cmis="http://www.mulesoft.org/schema/mule/cmis" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd 
http://www.mulesoft.org/schema/mule/cmis http://www.mulesoft.org/schema/mule/cmis/current/mule-cmis.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
   <cmis:config name="CMIS" username="*****" password="*****" repositoryId="6ddd8d97-e591-4327-bdaf-3e7be8604273" baseUrl="http://localhost:8080/alfresco/service/api/cmis" 
   doc:name="CMIS"/>
   <flow name="createDocumentFlow" doc:name="createDocumentFlow">
    <file:inbound-endpoint path="/home/administrator/Downloads/Output" responseTimeout="10000" doc:name="File"/>
       <cmis:create-document-by-path filename="#[header:originalFilename]"  folderPath="/Sites" 
       mimeType="application/pdf" objectType="cmis:document" versioningState="NONE" config-ref="CMIS" doc:name="CMIS"/>
   </flow>
</mule>

我在这里做错了什么?

【问题讨论】:

  • 您可以在您的问题中添加例外吗?
  • 我们实际上遇到了一个关于不接受字节数组或文件流的异常,但我们通过执行对象到字节数组的转换来修复它(谁知道)。

标签: alfresco mule cmis


【解决方案1】:

这最终工作得很好。使用 Object-to-byte-array-transformer 而不是 File-to-byte-array-transformer。

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
    xmlns:cmis="http://www.mulesoft.org/schema/mule/cmis" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd 
http://www.mulesoft.org/schema/mule/cmis http://www.mulesoft.org/schema/mule/cmis/current/mule-cmis.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd ">
   <cmis:config name="CMIS" username="*****" password="*****" repositoryId="6ddd8d97-e591-4327-bdaf-3e7be8604273" baseUrl="http://localhost:8080/alfresco/service/api/cmis" 
   doc:name="CMIS"/>
   <flow name="createDocumentFlow" doc:name="createDocumentFlow">
    <file:inbound-endpoint path="/home/administrator/Downloads/Output" responseTimeout="10000" doc:name="File" />
       <object-to-byte-array-transformer mimeType="application/pdf" doc:name="Object to Byte Array"/>        
       <cmis:create-document-by-path filename="#[header:originalFilename]"  folderPath="/OCR" 
       mimeType="application/pdf" objectType="cmis:document" versioningState="NONE" config-ref="CMIS" doc:name="CMIS"/>
   </flow>
</mule>

【讨论】:

    【解决方案2】:

    试试 cmis 同步 cmissync.com/

    它对我来说很好,它总是与你的系统同步。 可用选项:版本控制、签出、签入、编辑方面、元数据等。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多