cancel
Showing results for 
Search instead for 
Did you mean: 

How to get or download a document from CMIS

shiv
Champ on-the-rise
Champ on-the-rise
Hi

Im using CMIS(java) and Alfresco-Opencmis-Extension and im able to fetch the properties or metadata of the document stored in alfresco repository by writing the query.
Now how can i obtain the document from this metadata with its contents.
I need to have a download link for the document and i need to download the document in my local system for which the metadata is obtained.
Can u please guide on how to accomplish this or point me to some documentation or examples where this can be achieved.
2 REPLIES 2

jspuchau
Champ in-the-making
Champ in-the-making
You should be able to retrieve the unique id of the document. With the id you should be able to get a Docuemnt instance that has a getContentStream method to return the content of the document.

With the id you can build a link to access directly to the content through the repository.

I hope this will be helpful,
JSP

angello0571
Champ on-the-rise
Champ on-the-rise
Alfresco sees every document and folder as a node, so if you know the nodeRef, you can access the documents and file through CMIS API, NodeService API (CRUD of nodes) and ContentService API (to get the contenStream of the files)

Look this link, is absolutly useful http://wiki.alfresco.com/wiki/NodeRef_cookbook

I hope it helps you.

Regards!