Nuxeo is an Enterprise Content Management (“ECM”) system. Nuxeo keeps track of documents from creation to deletion. But even after deletion of a document, Nuxeo allows privileged users to manage those documents. Read on to learn how to delete a document, find a deleted document, and restore a deleted document. Simple enhancement of the delete functionality is also discussed.

In Nuxeo Platform 7.0, navigate to a document which is ready to be deleted. Then navigate back to the parent document’s Content tab. Check the box next to the name of the document to be deleted. Multiple documents could be selected at this time to be deleted simultaneously. A series of buttons should appear at the bottom of the list of contents once an item is checked. Click the “Delete” button to delete this document (or documents). Then confirm by clicking “OK”.

defaultdelete

The parent document can also be deleted. Navigate up a level in the navigation tree, select and delete the parent as well.
Once these documents are deleted, they will no longer appear in the Content tab of the parent document. They will no longer appear on the left navigation tree, either. In order to manage the deleted documents, navigate to the parent of the document that was deleted. In this case, that parent is the Granite Horizon Workspace. Then click the “Manage” tab, and then click the “Trash” subtab.

trash

The action button that is available is “Empty trash”. Select the checkbox next to the parent document (in this case, Granite Horizon Folder) and the options “Permanent delete” and “Restore” appear. Click “Restore” to restore the parent document (Granite Horizon Folder) and all of its subitems. Or, click “Permanent delete” to permanently delete the parent document and all of its subitems. Note that the original child document(s) that were deleted are not listed. Click on the parent document (Granite Horizon Folder) to view the deleted subitems. If the subitems are restored, the parent will be restored as well.
Note that the location where the deleted documents are accessible is the immediate parent document’s Manage/Trash location. In this example, the Granite Horizon Workspace contains the Granite Horizon Folder in the trash. However, the Granite Horizon Workspace’s parent, Workspaces, has nothing in the trash. This may be inconvenient, as it might mean navigating through many documents to find a deleted document. One way around this is to implement a “Domain trash” or a “Workspace trash” at a high level using Nuxeo Studio. This could contain all the deleted documents for that domain and/or workspace. One simple solution to this is to create a content view that shows deleted documents where the path “STARTSWITH” the current document path. The Query filter would look like this:

ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState = 'deleted' and ecm:path STARTSWITH ?

and the Query parameter is

#{currentDocument.path}

In order to make this behave like the default Trash tab, add a couple user actions called “Restore” and “Permanent delete”. These can be added directly to the Content View by clicking on “Results” -> Enable additional actions -> Create a new action.
Then add this content view to a Tab on the document desired. Enhance this by adding a search filter.
Out of the box, Nuxeo allows users to delete documents, delete parent documents, restore subtrees and permanently delete subtrees and individual documents. With some customization, some high-level management of deleted documents can be added. Worth noting is that Nuxeo’s delete feature can be controlled by ACLs. In addition, a document’s versions can be deleted using the History -> Archived versions tab. This can also be managed by ACLs.
Any questions or comments? Please chime in!

Read More
Nuxeo is an ECM system. Nuxeo keeps track of a document’s history, tracking important facts about the document’s creation and about each edit. Many document types in Nuxeo come with a “History” tab enabled by default. This tab displays document event and version information. Nuxeo provides the document’s history information. Also, Nuxeo offers document versioning out of the box. These are useful tools in tracking the change history of a document. Customization of the Versioning feature using Nuxeo Studio may improve Nuxeo’s default behavior to suit business requirements.

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.

eventlog_reference

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.

incrementversion_reference

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.

archivedversion1_reference

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.

archivedversion2_reference

The Compare feature renders a diff of the selected versions, if the Nuxeo Diff Marketplace Package has been installed.

diff_reference

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.

Read More