Ousmane MBINTE
Ousmane MBINTE

Reputation: 742

How to use the Alfresco Interoperability APIs

I'm developing an application that interfacing with an Alfresco community 4.2. I read in the documentation that there were two ways to acces to the repository using REST API: - REST API - CMIS REST API I need for my application to: - List all users' root directories - List items in a directory - Recover a file - Share a document (folder, file etc ...) - Accessing the history of a file - Create and delete a user

At first I tried to use Apache Chemistery API by following an example found on Internet. You can see this post on this topic : CmisObjectNotFoundException when trying to access my Alfresco repository

Finally having no experience on this topicI thought it would be better to use the API REST provided by Alfresco to make CMIS call. Unfortunately this one is very little documented, I managed to make some REST calls http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom/children?Id=86f1c760-905e-4920-98a8-a6bdd10aa but the XML stream is not easy to understand   My question is : - What is the best use? CMIS REST Api? CMIS Client? - Where is the simple and clear definition of the REST APIs that make the CRUD in the GED repo? - How to access the User Area node

Thanks !

Upvotes: 0

Views: 483

Answers (1)

Jeff Potts
Jeff Potts

Reputation: 10538

List all users' root directories

Use OpenCMIS and either a query that uses the path to the user homes folder to get the results or use methods like getChildren to navigate the repository hierarchy.

List items in a directory

Sames as the above.

Recover a file

This will not be possible via CMIS. Instead, write a Java-backed web script. Your controller class will need to find the file in the archive store, then copy it into the spaces store to recover it.

Share a document (folder, file etc ...)

It depends on what you want to do here. If you just mean you want to adjust the permissions then it may be possible via CMIS. You could use OpenCMIS to add or remove locally-set permissions. But CMIS cannot break (or re-establish) ACL inheritance, so if you need to do that, CMIS won't work.

Similarly, if what you want to do is essentially the same thing as the "Quick Share" functionality in Alfresco Share, CMIS probably cannot help you (although I haven't tried it). Basically, if you can do it by setting properties, you can do it with CMIS, otherwise, write your own web script for this.

Accessing the history of a file

I'll assume you mean version history. If so, CMIS is fine.

Create and delete a user

CMIS cannot create or delete users or groups. Write your own web script or take a look at the 4.2 REST API for person objects.

Upvotes: 1

Related Questions