
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2020 03:37 AM
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.
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2020 04:24 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2020 04:24 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 09:14 AM
Hi @goranche89
Great that you accepted the solution - thanks!
Cheers,
Problem solved? Click Accept as Solution!
