Shall we access the comments of a node from CMIS object Id?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 10:15 AM
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]
cmisbjectId=Property [id=cmis
bjectId, display Name=Object Id, local name=objectId, query name=samlo.cmis
bjectId, 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]
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 02:06 PM
I am going to do substring of the cmisbjectid, to get rid off the version number, and pass it as the nodeid into the webscript to get the comments.
