Hi all,

I've added complex list support in nuxeo core.
This means you can define list properties of complex types like a list of attachements.

To define a list of content elements you can write this in your schema XSD file:


<?xml version="1.0"?>

<xs:schema
   targetNamespace="http://www.nuxeo.org/ecm/schemas/testList";
   xmlns:xs="http://www.w3.org/2001/XMLSchema";
   xmlns:nxs="http://www.nuxeo.org/ecm/schemas/testList";
   >

   <xs:include schemaLocation="core-types.xsd"/>

   <xs:complexType name="attachmentsList">
     <xs:sequence>
<xs:element name="item" type="nxs:content" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>

   <xs:element name="attachments" type="nxs:attachmentsList"/>
</xs:schema>

The value of a complex list property this is returned as a java.util.List object *but* when setting the value
you must use a org.nuxeo.ecm.core.api.ListDiff object
This is because of the client - server arch. of Nuxeo. This avoid sending the entire list content to the server when modifying only an element.

You can also use a java.util.List when setting the valkue but this will erase the current stored list and replace it with the new one.

Bogdan

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to