Modifying custom models

cancel
Showing results for 
Search instead for 
Did you mean: 
ally311
Member II

Modifying custom models

Jump to solution

I currently have an active custom model, generated by xml and one of the types is currently applied to a node.

When attempting to modify the code definition of the model (adding an aspect), I can't save the changes:

1. Is this because the type is active and applied?

2. Is there a way to modify models while they are applied? - as only one file is using the model currently, it's not a                problem, but when applied further this could cause some real issues down the line if the model needs to                change.

1 Solution

Accepted Solutions
douglascrp
Advanced II

Re: Modifying custom models

Jump to solution

Yes, you can.

But if what you need is to have the aspect as mandatory-aspect for a custom type, then you will have to go using two steps, being the first one to create the new aspect, but not defining it as mandatory-aspect.

Use some kind of batch processing to attach the new aspect to all the existing documents with this custom type.

After that, change the content model, but this time, defining the aspect as mandatory, and then, publish this new content model.

By doing to, all the new documents created after this second content model publication will have the aspect attached automatically for you.

View solution in original post

4 Replies
douglascrp
Advanced II

Re: Modifying custom models

Jump to solution

Hello.

It all depends on the change you are performing.

When you say "adding an aspect", what exactly do you mean?

Are you simply creating a new aspect definition?

Are you configuring the aspect as mandatory inside the type?

Can you share the content model xml file and highlight the changes you have made?

rohit9637
Established Member

Re: Modifying custom models

Jump to solution

Yeah making changes to existing applied model does give any error. It seems error lies in your model XML file.

ally311
Member II

Re: Modifying custom models

Jump to solution

Sadly I can't provide the xml file just now, but I was configuring the new aspect as mandatory.

I assume from your answer that that's where I was going wrong.

But I can add an aspect definition that isn't marked as mandatory?

douglascrp
Advanced II

Re: Modifying custom models

Jump to solution

Yes, you can.

But if what you need is to have the aspect as mandatory-aspect for a custom type, then you will have to go using two steps, being the first one to create the new aspect, but not defining it as mandatory-aspect.

Use some kind of batch processing to attach the new aspect to all the existing documents with this custom type.

After that, change the content model, but this time, defining the aspect as mandatory, and then, publish this new content model.

By doing to, all the new documents created after this second content model publication will have the aspect attached automatically for you.