Hi all
I get this error:
{"exception":"runtime","message":"03240394 Invalid node ref - does not contain forward slash: 590abfb1-a741-46dc-94c3-c6e8f6c53af5"}
when I try to set cm:categories for an object.
The id is a correct id of a category manually created in Alfresco (getted using CMIS).
I'm using PortCMIS and after creating a folder with all the aspects I try to update categories (I get the same error if I put the categories in the properties during the creation).
properties = new Dictionary<string, object>(); properties.Add("cm:categories", categories); newFolder.UpdateProperties(properties,true);
categories is a List<string> with all the ID of the categories I need.
I guess it's the wrong way to put the categories in the properties.....
I'm becoming crazy!
Thank you for any advice
Solved! Go to Solution.
Here are a couple of things to keep in mind:
1. Categories are modeled in an aspect called cm:generalclassifiable. So if you are going to set categories on a doc you will need to add the secondary object type with an ID of "P:cm:generalclassifiable" to the node by updating the cmis:secondaryObjectTypeIds property.
2. The cm:categories property is not a list of Strings, it is a list of IDs. So instead of trying to set the property with a list of Strings, try setting it with a list of CMIS ID objects.
Here is a gist that shows you how to add a category to a document using Groovy. It should give you an idea of how to do it.
Here are a couple of things to keep in mind:
1. Categories are modeled in an aspect called cm:generalclassifiable. So if you are going to set categories on a doc you will need to add the secondary object type with an ID of "P:cm:generalclassifiable" to the node by updating the cmis:secondaryObjectTypeIds property.
2. The cm:categories property is not a list of Strings, it is a list of IDs. So instead of trying to set the property with a list of Strings, try setting it with a list of CMIS ID objects.
Here is a gist that shows you how to add a category to a document using Groovy. It should give you an idea of how to do it.
Hi Jeff,
I was already using your first advice: I create the new object putting all properties and also secondary object type to "P:cm:generalclassifiable" (if I check in Alfresco everything is ok).
I get all the ids of category that I want to link to the object using something like the code in your link but I get the error when I try exactly what specified in the code.
If I try to change list of string to list of CmisObjectId i get this error: 'Property 'cm:categories' is an Id property!' because PortCMIS check if for ids I'm using strings.
So probably it's not possible to set categories using CMIS.....but what could be the alternative?
In RestAPI it's not available any method for categories....
I found my error!
I was using as category id their cmisbjectId instead of alfcmis:nodeRef
Thank you for your support!
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.