incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject Re: ManageableCollection
Date Thu, 23 Feb 2006 11:10:50 GMT
On 2/23/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com> wrote:
> #: Christophe Lombart changed the world a bit at a time by saying (astral date: 2/23/2006
12:42 PM) :#

> I cannot seem to find the Map usage. Can you point me to it pls.

ArrayList, Vector, Collection, List are supported by default.
If you want to manage a Map, you have to specify the attribute
"collectionClassName" in the collection descriptor. There is an
example in jcrmapping-testmappings.xml. The collectionClassName
contains the ManagableCollection implementation to use. See an example
in jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/hashmap

We can see how to support eg. HashMap, Map, ... by creating a default
implementation for the ManageableCollection interface.

See also ManageableCollectionUtil

In summary with the ManageableCollection, it is possible to support
any kind of collection or any kind of Map. The drawback is to write
severals implementations.



	<class-descriptor
className="org.apache.portals.graffito.jcr.testmodel.hashmap.Main"
jcrNodeType="nt:unstructured">
		<field-descriptor fieldName="path" path="true" />
		<field-descriptor fieldName="text" jcrName="text" />
		<collection-descriptor fieldName="elements" proxy="false"
		                      
elementClassName="org.apache.portals.graffito.jcr.testmodel.hashmap.Element"
		                      
collectionConverter="org.apache.portals.graffito.jcr.persistence.collectionconverter.impl.NTCollectionConverterImpl"
		                      
collectionClassName="org.apache.portals.graffito.jcr.testmodel.hashmap.HashMapElement"
/>
		
	</class-descriptor>


--
Best regards,

Christophe

Mime
View raw message