Overview of Document History in Nuxeo: Event Log and Archived Versions
The document’s History tab contains useful information about a document’s history for every edit: the performed action, the date the action was performed, the name of the user who performed the action, and so forth. When the document is edited, a field for “Change Comment” is available. When an edit is saved, the History -> Event log tab shows the change comment and the version number both in the Comment column. As with most tables in Nuxeo, the Event log can be easily exported to Excel.
The Nuxeo documentation on Document History is available here: http://doc.nuxeo.com/display/USERDOC/Document%27s+History
While the Event log is automatic, with the only user input being the Change Comment, the Versioning system requires direction from the user. The editor can choose to apply a version whenever they edit a versionable document. The editor can increment the version by a major or minor increment, or skip versioning altogether for that edit.
One of the versionable document types that comes with a new Nuxeo installation is the File document. When a File document is edited, the Version section appears, allowing the user to either apply a Major version increment, a Minor version increment, or Skip version increment. Skip is selected by default.
It is interesting to note that the original document is not assigned a version number on creation. Therefore, the History -> Archived versions table only shows a Version if one has been assigned when the document was edited – not when it was created. This means that the original document cannot be retrieved.
When the document is edited again, and another version increment is applied, then true work with versions can begin.
Once a document has two or more versions, the editor can perform a variety of functions on these versions: delete, compare, view, and restore.
The Compare feature renders a diff of the selected versions, if the Nuxeo Diff Marketplace Package has been installed.
Again, it is interesting to note that the original document cannot be compared, deleted, or restored.
This out of the box behavior can be customized to suit business needs.
When a client requires that a specific document type has a version assigned when the document is created, a simple event handler/automation chain can be created that does a major CheckIn when a versionable, regular document is created.
When a client requires that a certain document type, or set of document types, have a Major version assigned whenever the document is edited, the following XML Extension may be helpful:
<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="versioningRules"> <defaultVersioningRule> <options lifeCycleState="*"> <major default="true"/> </options> </defaultVersioningRule> <versioningRule enabled="false" typeName="File"/> </extension> <require>org.nuxeo.ecm.platform.forms.layouts.webapp.base</require> <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="layouts"> <layout name="document_edit_form_options"> <templates> <template mode="any">/layouts/layout_default_template.xhtml </template> </templates> <rows> <row> <widget>document_edit_comment</widget> </row> <row> <widget>document_edit_current_version</widget> </row> </rows> </layout> </extension>
Any questions? Have a better solution to share? Please contact us.