Platform Explorer / Nuxeo Platform 2023.23

Extension point directories

Documentation

This extension point can be used to register directory ui information.

Example:

    <directory layout="vocabulary" name="continent" sortField="label">
        <deleteConstraint class="org.nuxeo.ecm.directory.api.ui.HierarchicalDirectoryUIDeleteConstraint">
            <property name="targetDirectory">country</property>
            <property name="targetDirectoryField">parent</property>
        </deleteConstraint>
    </directory>
    <directory layout="country_vocabulary" name="country" sortField="parent"/>

The following fields can be used on a directory UI declaration :

  • name: name of the directory to display, as used in the directory declaration
  • layout: name of the layout to use for display. This layout must know how to render elements in a table, so it uses a specific template.
  • sortField: name of the field to sort on when presenting directory items in a table. Defaults to the directory id field if not set.
  • view: name of the JSF view to use to present the directory. Defaults to "view_directory" if not set.
  • enabled: boolean stating if the declaration is enabled. This is useful to disable some preceding declaration, as long as the same directory name is used. Defaults to "false" if not set.

Here the layouts "vocabulary" and "country_vocabulary" have to be registered as layouts. The delete constraint uses a standard class that checks if no child entry references a parent entry before granting deletion of the parent entry. The following parameters can be used on this class:

  • targetDirectory: the directory holding the constraint (the child directory).
  • targetDirectoryField: the field specifying the parent id in the child directory.

Any other delete constraint can be set, taking other specific parameters, provided it follows the org.nuxeo.ecm.directory.api.ui.DirectoryUIDeleteConstraint

interface.

Contribution Descriptors

  • Class: org.nuxeo.ecm.directory.api.ui.DirectoryUIDescriptor

Existing Contributions

Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.

  • nuxeo-platform-webapp-core-2023.23.15.jar /OSGI-INF/directory-ui-contrib.xml
    <extension point="directories" target="org.nuxeo.ecm.directory.ui.DirectoryUIManager">
    
        <directory layout="vocabulary" name="continent" sortField="label">
          <deleteConstraint class="org.nuxeo.ecm.directory.api.ui.HierarchicalDirectoryUIDeleteConstraint">
            <property name="targetDirectory">country</property>
            <property name="targetDirectoryField">parent</property>
          </deleteConstraint>
        </directory>
        <directory layout="country_vocabulary" name="country" sortField="parent"/>
    
        <directory layout="vocabulary" name="topic" sortField="label">
          <deleteConstraint class="org.nuxeo.ecm.directory.api.ui.HierarchicalDirectoryUIDeleteConstraint">
            <property name="targetDirectory">subtopic</property>
            <property name="targetDirectoryField">parent</property>
          </deleteConstraint>
        </directory>
        <directory layout="subtopic_vocabulary" name="subtopic" sortField="parent"/>
    
        <directory layout="vocabulary" name="predicates" sortField="label"/>
        <directory layout="vocabulary" name="inverse_predicates" sortField="label"/>
        <directory layout="vocabulary" name="language" sortField="label"/>
        <directory layout="vocabulary" name="nature" sortField="label"/>
    
        <directory layout="l10ncoverage_vocabulary" name="l10ncoverage" sortField="id">
          <deleteConstraint class="org.nuxeo.ecm.directory.api.ui.HierarchicalDirectoryUIDeleteConstraint">
            <property name="targetDirectory">l10ncoverage</property>
            <property name="targetDirectoryField">parent</property>
          </deleteConstraint>
        </directory>
        <directory layout="l10nsubjects_vocabulary" name="l10nsubjects" sortField="id">
          <deleteConstraint class="org.nuxeo.ecm.directory.api.ui.HierarchicalDirectoryUIDeleteConstraint">
            <property name="targetDirectory">l10nsubjects</property>
            <property name="targetDirectoryField">parent</property>
          </deleteConstraint>
        </directory>
    
      </extension>
  • nuxeo-routing-default-jsf-2023.23.15.jar /OSGI-INF/extensions.xml
    <extension point="directories" target="org.nuxeo.ecm.directory.ui.DirectoryUIManager">
        <directory layout="vocabulary" name="WorkflowType" sortField="label"/>
      </extension>