Mathias Conradt
Mathias Conradt

Reputation: 28705

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

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:

DisplayPath & File Name:

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

QNamePath:

/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:

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]

Reference:

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

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

Upvotes: 0

Views: 1374

Answers (1)

Mathias Conradt
Mathias Conradt

Reputation: 28705

I found the problem, thanks to @Gagravarr for the hint:

I have to use the display path, but leave out /Company%20Home/ in the path, because the path used in the request url is taken as relative to the /Company%20Home node.

This works:

http://<host:port>/alfresco/service/cmis/p/Data%20Dictionary/Cleaner%20Configs/cleaner.properties/content?a=false

Upvotes: 1

Related Questions