Shall we access the comments of a node from CMIS object Id?

cancel
Showing results for 
Search instead for 
Did you mean: 
sepgs2004
Established Member

Shall we access the comments of a node from CMIS object Id?

In my application, we connect/access Alfresco repository using CMIS api.

There is a recent requirement - I have to access and manage the comments on a node (document).

I chose to use Rest API to access the comments through (existing) web scripts. 

I see the following in the web scripts...

GET /alfresco/s/api/comment/node/{store_type}/{store_id}/{id}

Let us say I am accessing a document with object id faa9214a-7d03-4ffd-9fd4-97e6ce8748f3

When I get the objectId from the CMIS object, I get it this way. Please note the version number appended in the end.

faa9214a-7d03-4ffd-9fd4-97e6ce8748f3;1.0

I access the comments of a node through 

server-host/alfresco/service/api/node/workspace/SpacesStore/faa9214a-7d03-4ffd-9fd4-97e6ce8748f3/comments?reverse=reverse

Please note that I have to give the object id without the version number to this url call.

I do not have experience in getting the id without the version number.

I also do not know if there is any difference between object id, node id, version id, version series id?

Anyways...

Can I strip the version number in code, from the cmis.objectid and use it to access the comments using the webscript?

I would like to confirm this. 

Or should I get or find the node id in a different better way.

When I access the node in CMIS workbench, I see the following properties that are related to the id.

Can I use any of these property values?

I see the following properties with their values

cmis:versionSeriesId=Property [id=cmis:versionSeriesId, display Name=Version series id, local name=versionSeriesId, query name=doc.cmis:versionSeriesId, values=[faa9214a-7d03-4ffd-9fd4-97e6ce8748f3]][extensions=null]

cmisSmiley SurprisedbjectId=Property [id=cmisSmiley SurprisedbjectId, display Name=Object Id, local name=objectId, query name=samlo.cmisSmiley SurprisedbjectId, values=[faa9214a-7d03-4ffd-9fd4-97e6ce8748f3;1.2]][extensions=null]

alfcmis:nodeRef=Property [id=alfcmis:nodeRef, display Name=Alfresco Node Ref, local name=nodeRef, query name=samlo.alfcmis:nodeRef, values=[workspace://SpacesStore/faa9214a-7d03-4ffd-9fd4-97e6ce8748f3]][extensions=null]

Gnanasekaran Sakthivel
1 Reply
sepgs2004
Established Member

Re: Shall we access the comments of a node from CMIS object Id?

I am going to do substring of the cmisSmiley Surprisedbjectid, to get rid off the version number, and pass it as the nodeid into the webscript to get the comments.

Gnanasekaran Sakthivel