cancel
Showing results for 
Search instead for 
Did you mean: 

api confusion

ddelapasse
Champ in-the-making
Champ in-the-making
Hi,

I'm brand new to Alfresco, but have been asked to use it for the backend of a doc mgmt project.   At the moment I'm constrained to the 4.2f community edition.  So far I've gone through a few tutorials and learned quite a bit.  I'm confused, though, about the various APIs.  I'm tasked with populating/retrieving documents of various custom types (tagged with new aspects I will create manually).  I'll need CRU functionality (no delete) for folders & docs/images/videos.  I'll need to attach metadata programmatically and query back by metadata values.

I've seen SO many references to the API.  I understand that there are both a general REST api and a CMIS api, but I believe the latter is really called "CMIS WebScript API" and I've read that WebScripts should no longer be used.   Please advise the best APIs to use for my needs before my googling fingers give out :-).

My project will have a web front-end, so while I can create my own Java wrapper API if required - if the REST calls exist I'd prefer to just call those directly!

thanks very much,
Deanna
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
First off, welcome to the Alfresco community. We're glad you're here.

There is a Public REST API which is comprised of CMIS and some non-CMIS calls.

The original CMIS implementation was based on web scripts but it is not any more. The WebScript-based implementation of CMIS is what you should not use, but, as I say, that's not an issue any longer provided you use the appropriate CMIS service URL.

When someone refers to "Web Scripts" without talking about CMIS they are either referring to out-of-the-box web scripts (the public ones are part of the Public API) or custom web scripts.

On a typical project you can and should write your own web scripts to give yourself RESTful end points that meet your specific needs or to fill gaps in the public API.

I hope this clears up the confusion.

Jeff

sebdavid
Champ in-the-making
Champ in-the-making
Hi,

I was searching for information about the difference between the Alfresco REST API (the Public REST API you mentionned I guess), and the Repository REST API because it leads me to confusion. More precisely, I was wondering which of those API we should use. I then arrived on this discussion.

I'm working with an on-premise 5.0.d.

I think CMIS API can be use for CRUD operations on nodes (folder, document, custom document types, etc.). Even aspects can be managed through CMIS, via the secondary types. I did some tests with the Apache chemistry OpenCMIS lib, it is quite simple. But when we have to work with Alfresco specificities (workflows, tasks, …), we have to use its REST API.

From the doc (http://docs.alfresco.com/community/concepts/dev-client-applications.html) :
- Alfresco REST API : lets us manage alfresco-specific features of content
- Repository REST API : I read that it is used by the Share to communicate with Alfresco

One main difference I faced to is that we can not start a workflow via the Repository REST API, whereas we can through the Alfresco REST API (management of "processes"). Is there a reason why we should not use the Repository REST API though it is exposed ? Because with both we can manage tasks, workflows, etc.

Sébastien.

jpotts
World-Class Innovator
World-Class Innovator
If you are going to use an out-of-the-box web script, check the web scripts console to see if the web script has a lifecycle declared. If it is marked "public" then you can use it. If it is marked anything else, you may want to think twice about using it, or at least be prepared for it to change without notice.

Jeff