Platform Explorer / Nuxeo Platform LTS 2019 10.10

Extension point directories

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 Descriptor

Existing Contributions

  • nuxeo-routing-default-jsf-10.10.jar /OSGI-INF/extensions.xml
    <extension point="directories" target="org.nuxeo.ecm.directory.ui.DirectoryUIManager">
        <directory layout="vocabulary" name="WorkflowType" sortField="label"/>
      </extension>
  • nuxeo-apidoc-repo-10.10.jar /OSGI-INF/directory-ui-contrib.xml
    <extension point="directories" target="org.nuxeo.ecm.directory.ui.DirectoryUIManager">
        <directory layout="vocabulary" name="documentationTypes" sortField="label"/>
    </extension>
  • nuxeo-multi-tenant-jsf-10.10.jar /OSGI-INF/directories-ui-contrib.xml
    <extension point="directories" target="org.nuxeo.ecm.directory.ui.DirectoryUIManager">
    
        <directory layout="multi_tenant_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="multi_tenant_subtopic_vocabulary" name="subtopic" sortField="parent"/>
    
        <directory layout="multi_tenant_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="multi_tenant_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-platform-webapp-core-10.10.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>