05-28-2012 02:17 PM
I created a new schema:
<?xml version="1.0"?>
<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/"
>
<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:restriction>
</xs:simpleType>
<xs:element name="parking_area" type="area51:vehicle_type"/>
</xs:schema>
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" />
</extension>
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">
<labels>
<label mode="any">Vehicle type</label>
</labels>
<translated>true</translated>
<fields>
<field>area51:parking_area</field>
</fields>
<properties widgetMode="any">
<property name="directoryName">area51:vehicle_type</property>
<property name="localize">true</property>
<property name="ordering">label</property>
</properties>
</widget>
</extension>
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(FacesServlet.java:277)
It would be nice if somebody could give me a hint, how to define the options.
05-31-2012 10:31 AM
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'.
05-31-2012 10:31 AM
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'.
05-31-2012 10:45 AM
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".)
05-31-2012 10:51 AM
SelectOneDirectory will indeed create a box like for nature. You'll get exactly the same if you replace
05-31-2012 06:36 PM
06-01-2012 06:39 AM
06-02-2012 02:09 PM
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)
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.