| Hippo CMS version | 6.01.00+ |
Document versioning and history in Hippo CMS
Configuration
- In the build.properties of Hippo CMS, add
cms.history.actions=on
- Run the repository initialization tool with
operation.createHistoryLocationAndSetAcl=true operation.assignReviewedActionsHistoryPrivilegesToRoles=true
This creates the history folder, ACLs and roles. If you use a different workflow, be sure to use the corresponding property.
For example, for the multiple sites workflow, you would useoperation.assignMultipleSitesDocumentHistoryPrivilegesToRoles=false
- Optionally, you can have versions created automatically on publication and/or unpublication. To use this, add a ConstantExtractor to extractors.xml in the repository namespace configuration. Note that you need to make sure the uri matches your repository layout - for the default layout as shipped with hippo-repository, the following will work:
<extractor classname="nl.hippo.slide.extractor.ConstantExtractor" uri="/files/default.preview/content" content-type="text/xml"> <configuration> <instruction property="createVersionOnPublication" namespace="http://hippo.nl/cms/1.0" value="true"/> <instruction property="createVersionOnUnpublication" namespace="http://hippo.nl/cms/1.0" value="true"/> </configuration> </extractor>
If you add these extractors after you have created files, you need to touch the files first before (un)publication. This can be done by saving them from the editor or use Hippo Touch.
More info
A version of a document (say /default/files/default.preview/content/foo/bar.xml) will be saved under the correponding path in the .history repository. The version document will be one level deeper than the original document: /default/files/default.history/foo/bar.xml/1.xml for version 1. So /default/files/default.history/foo/bar.xml is a collection, with all the versions as numbered documents (1.xml, 2.xml, 3.xml, etc.) under it.