Adding a new Aspect or adding a new attribute to existing bootstrapped content model

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

Adding a new Aspect or adding a new attribute to existing bootstrapped content model

I am using dictionaryBootstrap to bootstrap a content model. My jar version is 1.0 for both share and platform jar. 

    <bean id="com.mercuria.alfresco.bootstrap.modelLoader" parent="dictionaryBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/module/${project.artifactId}/model/test-model.xml</value>
            </list>
        </property>
    </bean>
</beans>

Now if I want to add more content model types, or add properties to the existing content model that was bootstrapped as part of version 1.0 above. For discussion sake, lets assume that test-model.xml has content model for Aspect-A. 

1. Lets say I want to add a new aspect called 'Aspect-B' to my content model, so can I add it to same file 'test-model.xml' and increment the version of the jar to 2.0? Is alfresco capable of differentiating an existing model that has already been bootstrapped, because some contents of my test-model.xml will also be in version 2.0. I am not sure how alfresco will deal with it or should I add only the new attribute?

2. If I want to add an additional attribute to Aspect-A and bootstrap the new attribute. How should I bootstrap an additional attribute to an existing bootstrapped aspect in alfresco instance?

2 Replies
cesarista
Customer

Re: Adding a new Aspect or adding a new attribute to existing bootstrapped content model

Hi:

1. Yes, incremental changes on a bootstrap content model are allowed. So adding a new aspect is possible.

2. Adding a new property in aspect A is also an incremental change, so it is also possible. But, in this case you may need to update your existing content for setting the values on the new property.

Any change on the bootstrap content model is better without data, when the model may be disabled and deleted without problems.

Regards.

--C.

kartech11
Active Member II

Re: Adding a new Aspect or adding a new attribute to existing bootstrapped content model

Thanks @Cesar Capillas

I added a new attribute to my model, and also have it setup in the share-config-custom.xml file under the field visibility section and appearance. But when I bootstrap the JAR with this new attribute I don't see the new attribute showing up under my model when I look it up in the Model Manager. 

I see from the logs that the 

2018-08-01 11:13:47,412 INFO [repo.module.ModuleServiceImpl] [localhost-startStop-1] Upgrading module 'alfresco-bootstrap-platform-jar' version 5.6 (was 5.5).
2018-08-01 11:13:47,430 DEBUG [repo.module.ModuleComponentHelper] [localhost-startStop-1]
Started module 'ModuleDetails[{module.version=5.6, module.description=Platform/Repo JAR Module (to be included in the alfresco.war) -
part of AIO - SDK 3, module.id=alfresco-bootstrap-platform-jar, module.repo.version.max=999,
module.title=Alfresco Platform/Repository JAR Module, module.repo.version.min=0, module.installState=UNKNOWN}]' including 21components.