0

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 !

Community
  • 1
  • 1
Ousmane MBINTE
  • 664
  • 4
  • 15
  • 37
  • Why would you try to write your own CMIS client? Just use one of the many well-tested open source CMIS clients, and be done with it1 – Gagravarr Jan 25 '17 at 05:27
  • I just want implement CRUD using Apache Chemistry or Alfresco CMIS REST API – Ousmane MBINTE Jan 25 '17 at 10:01
  • Just use one of the many well-tested open source CMIS clients to talk to Alfresco via CMIS to do your CRUD then! – Gagravarr Jan 25 '17 at 10:08
  • have you an exemple ? – Ousmane MBINTE Jan 25 '17 at 13:14
  • 1
    Depends on what language you use, try http://chemistry.apache.org/python/docs/examples.html#get-a-repository-object or https://chemistry.apache.org/docs/cmis-samples/samples/retrieve-objects/index.html for starters! – Gagravarr Jan 25 '17 at 15:49
  • please read this post it will help you to understand [cmis or web scripts use?](http://stackoverflow.com/questions/42495054/cmis-or-web-scripts-use/42497486#42497486) – Yagami Light Feb 28 '17 at 15:06

1 Answers1

1

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.

Jeff Potts
  • 10,468
  • 17
  • 40