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.
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.
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)