How to generate a select list from a simpleType of a custom schema?

I created a new schema:

<?xml version="1.0"?>

  <xs:simpleType name="vehicle_type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Car"/>
      <xs:enumeration value="Airplane"/>
      <xs:enumeration value="X-Plane"/>
      <xs:enumeration value="Ufo"/>

  <xs:element name="parking_area" type="area51:vehicle_type"/>

The schema was imported via the extension point schema of TypeService:

<extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
    <schema name="area51" src="schemas/process_request_form.xsd" prefix="area51" />

Additionally the schema was used for an user defined document type. This works.

Additionally I added a layout to the extension point types of TypeService. The layout was added via the extension point layouts of WebLayoutManager. This works too.

The problem is the widget which I created for the new layout:

<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="widgets">

 <widget name="type_of_vehicle" type="selectOneDirectory">

    <label mode="any">Vehicle type</label>

  <properties widgetMode="any">
    <property name="directoryName">area51:vehicle_type</property>
    <property name="localize">true</property>
    <property name="ordering">label</property>



It is no problem to display the document but if I try to edit the document then an excpetion occurs:

stackTrace : javax.servlet.ServletException: failed to build option list for directory     area51:vehicle_type
             at javax.faces.webapp.FacesServlet.service(

It would be nice if somebody could give me a hint, how to define the options.

0 votes

1 answers



Hi Michael,

The directoryName property is set to 'area51:vehicle_type'. It should be in fact the id of the directory you're using to build your list option. Right now Nuxeo looks for a directory called 'area51:vehicle_type'. You can replace it for instance by 'continent'.

0 votes

So the widget type selectOneDirectory is completely wrong. Is there an alternative to create a select box which makes it possible to select one type? (I look for a way to create a select box like for "nature".)

SelectOneDirectory will indeed create a box like for nature. You'll get exactly the same if you replace

&lt;property name=&quot;directoryName&quot;&gt;area51:vehicle_type&lt;/property&gt;


&lt;property name=&quot;directoryName&quot;&gt;nature&lt;/property&gt;

What you need to do now is create a directory called for instance vehicle_type containing the different options you need.


  1. Is there any alternative without creating directories?
  2. Where is the nature directory or with other words where should I create the directory?

  1. Using a custom widget instead of SelectOneDirectory.
  2. Directories can be used for many things in Nuxeo. It's basically a low-level interface to a database table. Users and Groups are for instance managed in Directories. The vocabularies in the AdminCenter are also based on directories. It will become handy if for instance you need to add a new type of vehicle. So about creating directory, here's the documentation of the associated extenstion point:

First thanks for your patience. I didn't notice the meaning of directory. Second here are the links to the documentation and to an example (just for completeness):

Third I will extend the dev cookbook.