cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying custom models

ally311
Champ in-the-making
Champ in-the-making

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 ACCEPTED ANSWER

douglascrp
World-Class Innovator
World-Class Innovator

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 answer in original post

4 REPLIES 4

douglascrp
World-Class Innovator
World-Class Innovator

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?

ally311
Champ in-the-making
Champ in-the-making

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
World-Class Innovator
World-Class Innovator

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.

rohit9637
Star Contributor
Star Contributor

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