JSF UI Framework

Document List Management

Updated: July 17, 2023

Management of a lost of documents is useful for clipboard and generally document selection features.

The Document List Manager provides a service to manage lists of Nuxeo documents.

These lists of documents can have properties such as:

A name, defined by name attribute. A scope (session or conversation), defined by <isSession/> tag - it defines if the memory storage occurs in the Seam session context or in the Seam conversation context. * A persistence (SQL directory or not present), defined by <persistent/> tag - the service persists only the list of the document references, not the real documents; the lists of document references is persisted in a SQL directory, which is generic and does not need any configuration.

The lists of documents can be invalidated when Seam events are raised. This is useful, for example, for resetting CURRENT_SELECTION lists when the user change the current folder or when a new search is performed.

Documents lists can be defined like in the following example ( OSGI-INF/documentslists-contrib.xml ):

<extension target="org.nuxeo.ecm.webapp.documentsLists.DocumentsListsService" point="list">

  <documentsList name="CLIPBOARD">
    <category>CLIPBOARD</category>
    <imageURL>/img/clipboard.gif</imageURL>
    <title>workingList.clipboard</title>
    <defaultInCategory>false</defaultInCategory>
    <supportAppends>false</supportAppends>
  </documentsList>

  <documentsList name="CURRENT_SELECTION">
    <events>
      <event>folderishDocumentSelectionChanged</event>
      <event>searchPerformed</event>
    </events>
    <isSession>false</isSession>
  </documentsList>

</extension>

Here is a sample code to get the list of selected documents within a Seam Component:

@In(create = true)
protected transient DocumentsListsManager documentsListsManager;

public boolean getCanCopy() {
    if (navigationContext.getCurrentDocument() == null) {
        return false;
    }
    return !documentsListsManager.isWorkingListEmpty(DocumentsListsManager.CURRENT_DOCUMENT_SELECTION);
}