cancel
Showing results for 
Search instead for 
Did you mean: 

applying versioning without modifying base contentmodel?

hazmat
Champ in-the-making
Champ in-the-making
i'd like to apply versioning to all content in the system, the only docs on how to do so require owning the base alfresco contentmodel.xml, as documented here, http://wiki.alfresco.com/wiki/Versioning_Behaviour, which i'd prefer not to do for maintainence reasons.

.. is it possible to weave an aspect in via configuration to the base content model, cm:content in particular.

thanks.
4 REPLIES 4

davidc
Star Contributor
Star Contributor
Not at this moment, but is a feature we should add.  In the mean-time, you should be able to create a rule on the root folder which adds the versioning aspect.

hazmat
Champ in-the-making
Champ in-the-making
given the option of applying a recursive rule to the root, is it possible to specify this a rule for a  space via the space bootstrap configuration? alternatively is there a way to specify via configuration to run some custom code during boostrap, so we can achieve the same.

we're trying to build out straight from svn for a dev/stage/prod setup, and manual configuration through the web, isn't viable.

davidc
Star Contributor
Star Contributor
The bootstrap process uses the importer to load the initial set of data into the repository when it's started for the very first time.

Within /config/alfresco/bootstrap, you'll find the xml files that are imported.  There's one called spaces.xml which creates the Company Home folder and its sub-folders i.e. data dictionary and guest.

So, you can adjust this file by adding the rule definition to the Company Home folder.  What's the xml for the rule definition?  The easiest way to generate is to go into the Web Client, create the rule on the Company Home folder and export the Company Home folder.  The resulting xml will consist of the rule definition which you can copy into spaces.xml.

You can just change the existing spaces.xml, but if you upgrade, then you'll lose your changes.  So, as with all customisations, you should use Alfresco's extension mechanism.

Within /config/alfresco, you'll find a bootstrap-context.xml file which lists all the processes (spring beans) that are executed during bootstrap.  You can override any of one these beans by providing your own replacement definition of the bean.  This is done by creating your own custom-context.xml (this can be any name) in /alfresco/extension.  The bean you want to override is spacesBootstrap.  You can copy its definition from bootstrap-context.xml.  You'll want to replace the reference to alfresco/bootstrap/spaces.xml with your own version of spaces.xml which can also live /alfresco/extension.

To test, start Alfresco on a clean database/alf_data directory and the bootstrap process will be initiated.

hazmat
Champ in-the-making
Champ in-the-making
thanks david, thats very helpful, and solves the problem neatly.