AnsweredAssumed Answered

Alfresco CMIS Web Scripts API for 'getContent' by path is not working

Question asked by mathias.lin on Nov 8, 2013
Latest reply on May 30, 2014 by spilby
I had read
http://forums.alfresco.com/forum/developer-discussions/alfresco-api/cmis-getcontent-example-09262012-1805
but did not find an OpenCMIS services URI / sample of how to fetch node content by providing it's path only, not it's UUID.

<strong>The problem:</strong>

I have a file in my Alfresco (4.1.5) repository of which I want to read the content through the Alfresco services REST API. For the lookup, I want to use the file path, not the UUID. However, the lookup by path does not work, only the lookup by UUID works. I cannot find the mistake.

This is the file path:

<strong>DisplayPath & File Name:</strong>

/Company Home/Data Dictionary/Cleaner Configs/cleaner.properties


<strong>QNamePath:</strong>

/app:company_home/app:dictionary/cm:Cleaner_x0020_Configs/cm:cleaner.properties


Lookup by UUID works with the following REST API url:

http://localhost:8080/alfresco/service/cmis/i/2391adf9-365c-4959-bf30-8f001154c100/content


However, lookup by path only does not work. Neither with the primary path nor the display path:

http://localhost:8080/alfresco/service/cmis/p/app:company_home/app:dictionary/cm:Cleaner_x0020_Configs/cm:cleaner.properties/content?a=false


http://localhost:8080/alfresco/service/cmis/p/Company%20Home/Data%20Dictionary/Cleaner%20Configs/cleaner.properties/content?a=false


I am getting a 404 error in both cases:

<blockquote>
Message:    10080001 Unable to find ObjectPathReference[storeRef=workspace://SpacesStore,path=/app:company_home/app:company_home/app:dictionary/cm:Cleaner_x0020_Configs/cm:cleaner.properties]

Exception:  org.springframework.extensions.webscripts.WebScriptException - 10080001 Unable to find ObjectPathReference[storeRef=workspace://SpacesStore,path=/app:company_home/app:company_home/app:dictionary/cm:Cleaner_x0020_Configs/cm:cleaner.properties]
</blockquote>


<strong>Reference:</strong>

http://wiki.alfresco.com/wiki/CMIS_Web_Scripts_Reference#Get_Content_.28getContent.29

<blockquote>
Gets the content stream for the specified document, or gets a rendition stream for a specified rendition of a document.

GET /alfresco/service/cmis/p{path}/content{property}?a={attach?}
</blockquote>

Outcomes