Hello,
I've created custom model with PortCmis and C#, with some custom aspects. Now I want to add some more custom aspects to that model. I've tried something like this:
var modelObject = session.GetObject("here-is-custom-model-id");
var aspectsTemp = modelObject.GetPropertyValue("cmis:secondaryObjectTypeIds");
IList aspects = (IList)aspectsTemp;
aspects.Add("P:goran:fourthAspect");
IDictionary<string, object> props = new Dictionary<string, object>();
props["cmis:secondaryObjectTypeIds"] = aspects;
modelObject.UpdateProperties(props, true);
But I'm getting this error: "Invalid secondary type id P:goran:fourthAspect".
Is there any solution how to add new custom aspect to previously created custom model?
Thanks.
Solved! Go to Solution.
You need to retrieve content of the model document which is an xml .operate the xml (add aspect definition under aspects sub elements) and save the xml content back to the model node.
You need to retrieve content of the model document which is an xml .operate the xml (add aspect definition under aspects sub elements) and save the xml content back to the model node.
Hi @goranche89
Great that you accepted the solution - thanks!
Cheers,
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.