AnsweredAssumed Answered

How can add mandatory aspect on cm:content type on runtime

Question asked by 4535992 on Jan 22, 2019
Latest reply on Jan 23, 2019 by openpj

Hi i need to add "mandatory aspect" on the default alfresco type "cm:content" on runtime without touching the xml model configurations.


So the solution i'm using now is the classic create a custom type with parent "cm:content" like in the following code:


        <type name="up:UploadFile">
            <title>Uploader Plus File</title>
                 <property name="up:classifiCationAspect2">
                  <title>Classification Aspect 2</title>
                  <index enabled="true">
                    <constraint ref="up:classificationAspectListConstraint" />
                <association name="up:files">
                    <title>Related Documents</title>


But i need to the same thing with java code, by adding the mandatory aspect to the "cm:content" on runtime. There is some alfresco service to do that?


I can accept even a java code to modify custom model on runtime .