Maybe your new schema is not registered ok.
I suggest you start again using a fresh repository (remove
jboss/server/default/data/NXRuntime and restart jboss).
If you do not want to remove your repository, you can try to set the
property "forceReloadTypes" to "true" in
nuxeo.ear/config/default-repository-config.xml and restart jboss.
Craig Pugsley a e'crit :
So we're very keen to, at this stage, just get a document into Nuxeo
using a very cut down schema and start evaluating some of the other
elements of the system. We're already using a schema very similar to the
one you suggested (just a couple of simple elements with no attributes),
however we are getting another problem:
15:58:53,990 ERROR [JCRDocument] Error setting value: Version 1.0.0 on
property: Version
15:58:53,991 ERROR [ClientException] ClientException created...
org.nuxeo.ecm.core.api.ClientException: Failed to create document
my-new-policy
at
org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:525)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: org.nuxeo.ecm.core.api.DocumentException: failed to set
boolean property Version
at
org.nuxeo.ecm.core.jcr.properties.StringProperty.create(StringProperty.java:45)
at
org.nuxeo.ecm.core.jcr.properties.JCRScalarProperty.setValue(JCRScalarProperty.java:90)
at
org.nuxeo.ecm.core.jcr.JCRDocument.setPropertyValue(JCRDocument.java:430)
at
org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:336)
at
org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:498)
... 217 more
Caused by: javax.jcr.nodetype.ConstraintViolationException: no matching
property definition found for {}Version
at
org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:771)
at
org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:926)
at
org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:457)
at
org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:407)
at
org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2121)
at
org.nuxeo.ecm.core.jcr.properties.StringProperty.create(StringProperty.java:42)
... 221 more
In 'ecm-types-contrib.xml', we are using:
<type id="Policy" coretype="policy">
<label>PolicyMatter Document</label>
<icon>/icons/pmLogo16.png</icon>
<default-view>view_documents</default-view>
<layout>
<widget jsfcomponent="h:inputText"
schemaname="dublincore" fieldname="title"
required="true"/>
<widget jsfcomponent="h:inputText"
schemaname="policy" fieldname="Version"
required="true"/>
<widget jsfcomponent="nxu:editor"
schemaname="policy" fieldname="Content" />
<widget jsfcomponent="nxdir:selectOneListbox"
schemaname="dublincore" fieldname="language"
directory="sample_languages"/>
</layout>
</type>
...with the schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://policy.policymatter.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="Version" type="xsd:string"/>
<xsd:element name="Content" type="xsd:string"/>
</xsd:schema>
Any idea what could be going on here?
Craig Pugsley
Technical Consultant - PolicyMatter Ltd
On 23 May 2007, at 15:26, Anahide Tchertchian wrote:
Hi,
Question 1: What is the correct way to reference the 'name'
attribute on the 'RULE-POOL' element in 'ecm-types-contrib.xml'?
You cannot bind individual sub-elements (like the RULE/name field) to
a widget.
Each schema element is seen as an indivisible entity when editing it.
(you cannot edit only parts of a element)
So when you have complex elements in a schema like in your case you
need to bind the complex element to an widget
to edit it as an indivisible entity.
For this you may create a custom JSF widget that is able to show two
text boxes for your 2 sub-elements.
For simple elements like strings it is easy because you can use
existing widgets but for complex elements I think you need
to create your own widgets.
In future we will provide a generic widget for complex types (that
will generate forms to edit a complex type)
but for now we don't have such a widget.
May be people more experienced with JSF can help you on this.
So the question is how a complex field can be bound to an widget or
how can it be edited.
Is nuxeo web framework providing some generic mechanism for this?
Anahide any hint?
When we have the API to set a sub property on a document model, maybe
this will be possible. Currently we're using the current syntax:
<h:inputText value="#{document.schemaName.fieldName}" />
This will trigger the document.setProperty(schemaName, fieldName,
value) when setting the value.
A syntax like would not be able to trigger the setProperty method on
the document:
<h:inputText value="#{document.schemaName.fieldName.subFieldName}" />
Question 2: Is there any documentation on the the '<widget>'s that
are available to use in 'ecm-types-contrib.xml'? Specifically, I
would like to know how to change the display name of this field, so
it doesn't appear to the user as 'RULE-POOL:name', but something
more human-readable, and would also know what types of widgets are
available to display the data.
There is no documentation yet as this mecanism is not done yet: the
layout system is not configurable enough to address non-simple use cases.
If you can, I would suggest that you change your schema for now into:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://policy.policymatter.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:element name="name" type="xsd:string" use="required" />
<xsd:element name="version" type="xsd:string" use="required" />
</xsd:schema>
Regards,
--Anahide Tchertchian, Nuxeo
Mail: [EMAIL PROTECTED] - Tel: +33 (0)1 40 33 79 87
http://www.nuxeo.com - http://www.nuxeo.org
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm