You are here

Making all content versionable

Edit the contentModel.xml file to enable versioning for all content in the repository.

  1. Download the contentModel.xml file.

    If you are deploying a nightly build, you might prefer to extract the contentModel.xml file from the deployed alfresco.war file to ensure you have the correct version.

  2. Create a $TOMCAT_HOME/shared/classes/alfresco/extension/models directory.
  3. In the contentModel.xml file, search for <type name="cm:content">, and immediately after the closing </properties> tag, insert the following lines to make the content versionable:

    <mandatory-aspects>       
        <aspect>cm:versionable</aspect>    
    </mandatory-aspects>
  4. Copy the edited contentModel.xml file to the $TOMCAT_HOME/shared/classes/alfresco/extension/models directory.
  5. Add a Spring context file to $TOMCAT_HOME/shared/classes/alfresco/extension with the following lines:

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
    
    <beans>
        <bean parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
            <property name="models">
                <list>
                    <value>alfresco/extension/models/contentModel.xml</value>
                </list>
            </property>
        </bean>
    </beans>
  6. Save the file.
  7. Restart the Alfresco Community Edition server.
Uploaded content will then have the cm:versionable aspect.

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.