2012-10-24 95 views
2

因此,我使用Mule來抓取放入文件夾的文件,並且我想通過CMIS連接器將這些文件推送到Alfresco。我有Alfresco啓動並運行,但在嘗試移動文件時,我一直在Mule中遇到錯誤。下面是我的流程:Mule ESB使用CMIS連接器將文件移動到Alfresco

<?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> 

我在做什麼錯在這裏?

+0

您能否將異常添加到您的問題中? – genjosanzo

+0

我們實際上得到了一個關於不接受字節數組或文件流的例外,但我們通過執行Object-to-ByteArray轉換(誰知道)來修復它。 – Thaneofife

回答

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> 
0

嘗試CMIS同步cmissync.com/

它工作正常,我和它總是與您的系統同步。 可用選項:版本控制,結帳,簽入,編輯方面,元數據等。