Dynamic Content Models in Alfresco

In previous few articles like content modeling in Alfresco I have explained about content models in alfresco now there is one great feature in alfresco which enables you to create and use Content model on the fly without Restarting server.

Location of Dynamic custom models: Company Home -> Data Dictionary -> Models. The associated message resource bundles Location: Company Home -> Data Dictionary -> Messages

How to Deploy and activate a custom model?

Upload a custom XML model file to the ‘Models’ space. By default, the model will not be active unless the ‘Model Active’ checkbox is selected during the upload. To activate a previously inactive model, select ‘View Details’ and then select the ‘Modify’ properties icon. In the ‘Modify Content Properties’ page, select the ‘Model Active’ checkbox.

Dynamic Content Model

Dynamic Content Model

How to update custom model?

Edit or update the XML model file. If the model is active then it will be re-loaded. If the file is checked-out then the working copy will be ignored until such time that the file is checked-in.

NOTE: Only incremental updates are supported for an active model. If the update attempts to delete a type, aspect, property (etc) then the upload will fail. The reason for the failure can be seen in the Alfresco console, although the web client may (currently) display a more cryptic error message such as ‘A system error happened during the operation: Unknown Exception in Transaction.’

How to deactivate a custom model?

To deactivate a model, select ‘View Details’ and then select the ‘Modify’ properties icon. In the ‘Modify Content Properties’ page, unselect the ‘Model Active’ check box.

To delete a model, select Delete.

NOTE: The model can only be deleted if there are no existing usages, otherwise the delete will fail. The reason for the failure can be seen in the Alfresco console, although the web client may display a more cryptic error message such as ‘A system error happened during the operation: Unknown Exception in Transaction.’ or ‘Unable to delete File due to system error:’ “No existing usages” includes deleted items that are still accessible through Manage Deleted Items in the user profile and settings page.

Using the Repository Admin Console

The Repository Admin console can be used (as an alternative to the Web Client) to deploy, activate and deactivate models. It can also be used to deploy, re-load and undeploy message resource bundles.

http://localhost:8080/alfresco/faces/jsp/admin/repoadmin-console.jsp

Updating and re-loading web client configuration

If the ‘web-client-config-custom.xml‘ file has been added, edited or updated, it can be dynamically reloaded by using the web client config console via:

http://localhost:8080/alfresco/faces/jsp/admin/webclientconfig-console.jsp

This has a single command ‘reload’ which will cause the web client configuration to be re-loaded. Depending on your setup, you will see console output such as:

Dynamic Content Model Deployment

Dynamic Content Model Deployment

If the file is checked-out then the working copy will be ignored until such time that is it checked-in.
NOTE: Unlike dynamic models, the configuration file does not have an active/inactive flag. Hence, even if you do not dynamically re-load the configuration after the update, it will still be loaded next time the server is restarted. If the config is invalid (e.g. cannot be parsed) then it will be skipped during loading and an error will be logged.

This will certainly save your lot of development time. Hope this helps you.

Looking for quality Alfresco Web Hosting? Look no further than Arvixe Web Hosting!

Posted under Alfresco | RSS 2.0

Author Spotlight

mitpatoliya

mitpatoliya

I love opensource technologies working with those technologies from the time I have stepped in to the Software Industry. Alfresco CMS is my area of expertise. I have worked on various complex implementations which involved integration of Alfresco with other technologies, extensively worked with JBPM workflows and Webscripts.

Leave a Reply

Your email address will not be published. Required fields are marked *


9 × 7 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>