AnsweredAssumed Answered

Creating DataLists and Items vi API - Looking for Help and Pointers

Question asked by tedmasterweb on Oct 27, 2014
Latest reply on Oct 27, 2014 by tedmasterweb
Hi,

I've read numerous articles <a href="https://forums.alfresco.com/forum/developer-discussions/alfresco-api/cmis-resources-tutorials-and-examples-03212012-1456">here</a> and elsewhere on the Internet trying to learn how to put a face on an Alfresco installation and although I'm making progress, I'm having trouble understanding a couple things. If you have a moment and can point me in the right direction I would be very grateful.

So far I've installed Alfresco locally and can log in perfectly at http://localhost:8080/share and do all the things one would expect. Since the project we're working on will not be used by expert users we're trying to create a very basic web interface that suits their needs. It is my understanding that we can make calls to the server via APIs, calls that will allow us to do everything we need in the repository.

We've got some basic read operations working thanks to <a href="http://ecmarchitect.com/images/articles/cmis/cmis-article.pdf">Jeff's (old) article</a> (after having modified the URLs to account for the difference in versions: we're using 5.0 and the articles seem to have been written for 4.0 or earlier) and we can create folders and upload some documents as the article describes, but we're still very much at a loss on how to do anything other than what's in the article.

Jeff's article implies that if I want to create a node in the repo it is as simple as POSTing an Atom document to the corresponding Atom (service) URL: http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom. That seems like a very reasonable approach however, I'm not sure what the structure for the document should be. For example, I tried downloading the Atom document for a dataList, modifying it (changing the name and title, removing attributes like it's ID so we don't have a conflict) and yet something isn't working. I've read the CMIS documentation (well, skimmed and searched it) at http://docs.oasis-open.org/cmis/CMIS/v1.1/os/CMIS-v1.1-os.html and there are no mentions of dataLists (or not using that exact name).

I'm going to go out on a limb here and guess that since the data type for a list is F:dl:dataList that it is not actually a CMIS object and THAT is the first mistake we're making. Can someone confirm this? And if it is the mistake, what API should we be using for working with lists? http://localhost:8080/alfresco/s/index/package/org/alfresco/slingshot/datalists ??? And does anyone have an example of how to use this API? I've been unable to find an action for creating a list and I've been unable to find documentation on what the placeholders in this URL stand for (and whether or not they can be omitted):
/alfresco/s/slingshot/datalists/data/node/{store_type}/{store_id}/{id}

Assuming we happen upon the right format (which properties are required, what types their values need to be, etc) we then wonder how to tell the repo which Site the list should be in. I've seen references to cmis:path but I suspect that that is not sufficient (would love it if it were) for indicating where the new list should appear.

In the end, we'd like to know how to do the following via an API:

- Create a list in a given Site
- Modify the contents of the list

Sorry for the lengthy query… It's taken a fair amount of time to write it and I have to assume I'm not the only person in this situation so any help would be very much appreciated.

Sincerely,

Ted

Outcomes