<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to generate a select list from a simpleType of a custom schema? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325475#M12476</link>
    <description>&lt;OL&gt;
&lt;LI&gt;Using a custom widget instead of SelectOneDirectory.&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Fri, 01 Jun 2012 10:39:15 GMT</pubDate>
    <dc:creator>Laurent_Doguin</dc:creator>
    <dc:date>2012-06-01T10:39:15Z</dc:date>
    <item>
      <title>How to generate a select list from a simpleType of a custom schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325470#M12471</link>
      <description>&lt;P&gt;I created a new schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://project.nuxeo.org/schemas/dev/cookbook/example/pap/process-request-form/"
  xmlns:area51="http://project.nuxeo.org/schemas/dev/cookbook/example/pap/process-request-form/"
  &amp;gt;

  &amp;lt;xs:simpleType name="vehicle_type"&amp;gt;
    &amp;lt;xs:restriction base="xs:string"&amp;gt;
      &amp;lt;xs:enumeration value="Car"/&amp;gt;
      &amp;lt;xs:enumeration value="Airplane"/&amp;gt;
      &amp;lt;xs:enumeration value="X-Plane"/&amp;gt;
      &amp;lt;xs:enumeration value="Ufo"/&amp;gt;
    &amp;lt;/xs:restriction&amp;gt;
  &amp;lt;/xs:simpleType&amp;gt;

  &amp;lt;xs:element name="parking_area" type="area51:vehicle_type"/&amp;gt;
&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The schema was imported via the extension point &lt;CODE&gt;schema&lt;/CODE&gt; of &lt;CODE&gt;TypeService&lt;/CODE&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema"&amp;gt;
    &amp;lt;schema name="area51" src="schemas/process_request_form.xsd" prefix="area51" /&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Additionally the schema was used for an user defined document type. This works.&lt;/P&gt;
&lt;P&gt;Additionally I added a layout to the extension point &lt;CODE&gt;types&lt;/CODE&gt; of &lt;CODE&gt;TypeService&lt;/CODE&gt;. The layout was added via the extension point &lt;CODE&gt;layouts&lt;/CODE&gt; of &lt;CODE&gt;WebLayoutManager&lt;/CODE&gt;. This works too.&lt;/P&gt;
&lt;P&gt;The problem is the widget which I created for the new layout:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="widgets"&amp;gt;

 &amp;lt;widget name="type_of_vehicle" type="selectOneDirectory"&amp;gt;

  &amp;lt;labels&amp;gt;
    &amp;lt;label mode="any"&amp;gt;Vehicle type&amp;lt;/label&amp;gt;
  &amp;lt;/labels&amp;gt;
  &amp;lt;translated&amp;gt;true&amp;lt;/translated&amp;gt;
  &amp;lt;fields&amp;gt;
    &amp;lt;field&amp;gt;area51:parking_area&amp;lt;/field&amp;gt;
  &amp;lt;/fields&amp;gt;

  &amp;lt;properties widgetMode="any"&amp;gt;
    &amp;lt;property name="directoryName"&amp;gt;area51:vehicle_type&amp;lt;/property&amp;gt;
    &amp;lt;property name="localize"&amp;gt;true&amp;lt;/property&amp;gt;
    &amp;lt;property name="ordering"&amp;gt;label&amp;lt;/property&amp;gt;
  &amp;lt;/properties&amp;gt;

 &amp;lt;/widget&amp;gt;

&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is no problem to display the document but if I try to edit the document then an excpetion occurs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;stackTrace : javax.servlet.ServletException: failed to build option list for directory     area51:vehicle_type
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It would be nice if somebody could give me a hint, how to define the options.&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2012 18:17:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325470#M12471</guid>
      <dc:creator>Michael_Bell</dc:creator>
      <dc:date>2012-05-28T18:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a select list from a simpleType of a custom schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325471#M12472</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;
&lt;P&gt;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'.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2012 14:31:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325471#M12472</guid>
      <dc:creator>Laurent_Doguin</dc:creator>
      <dc:date>2012-05-31T14:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a select list from a simpleType of a custom schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325472#M12473</link>
      <description>&lt;P&gt;So the widget type &lt;CODE&gt;selectOneDirectory&lt;/CODE&gt; 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".)&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2012 14:45:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325472#M12473</guid>
      <dc:creator>Michael_Bell</dc:creator>
      <dc:date>2012-05-31T14:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a select list from a simpleType of a custom schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325473#M12474</link>
      <description>&lt;P&gt;SelectOneDirectory will indeed create a box like for nature. You'll get exactly the same if you replace&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2012 14:51:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325473#M12474</guid>
      <dc:creator>Laurent_Doguin</dc:creator>
      <dc:date>2012-05-31T14:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a select list from a simpleType of a custom schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325474#M12475</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Is there any alternative without creating directories?&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 31 May 2012 22:36:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325474#M12475</guid>
      <dc:creator>Michael_Bell</dc:creator>
      <dc:date>2012-05-31T22:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a select list from a simpleType of a custom schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325475#M12476</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Using a custom widget instead of SelectOneDirectory.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 01 Jun 2012 10:39:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325475#M12476</guid>
      <dc:creator>Laurent_Doguin</dc:creator>
      <dc:date>2012-06-01T10:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a select list from a simpleType of a custom schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325476#M12477</link>
      <description>&lt;P&gt;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)&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jun 2012 18:09:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-generate-a-select-list-from-a-simpletype-of-a-custom/m-p/325476#M12477</guid>
      <dc:creator>Michael_Bell</dc:creator>
      <dc:date>2012-06-02T18:09:24Z</dc:date>
    </item>
  </channel>
</rss>

