incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Koci <martin.k...@aura.cz>
Subject Re: VOTE : PersistenceManager & Mapper interface API
Date Wed, 07 Sep 2005 13:55:14 GMT
org.apache.portals.graffito.jcr.persistence.PersistenceManager#getObject(Class 
pojoClass, String path)  requires knowledge of persistent class but in 
some cases I know only path in repository.

Christophe Lombart wrote:

>ok but in which context this method can be usefull ? 
>
>2005/9/7, Martin Koci <martin.koci@aura.cz>:
>  
>
>>When I know path and therefore a JCR node and its note type I want to
>>know class mapped to note type. MappingDescriptor should have new method
>>'getClassNameForNodeType':
>>
>>public class MappingDescriptor {
>>private HashMap classDescriptors = new HashMap();
>>
>>private Map nodeTypeToClassMap = new HashMap();
>>
>>public void addClassDescriptor(ClassDescriptor classDescriptor)
>>{
>>classDescriptors.put(classDescriptor.getClassName(), classDescriptor);
>>nodeTypeToClassMap.put(classDescriptor.getJcrNodeType(),
>>classDescriptor.getClassName());
>>}
>>
>>public ClassDescriptor getClassDescriptor(String className)
>>{
>>return (ClassDescriptor) classDescriptors.get(className);
>>}
>>
>>public String getClassNameForNodeType(String nodeType) {
>>return (String) nodeTypeToClassMap.get(nodeType);
>>}
>>
>>}
>>
>>
>>and DigesterMapperImpl new method:
>>
>>public Class getClassForNodeType(String nodeType) throws
>>JcrMappingException {
>>String classNameForNodeType = null;
>>try {
>>classNameForNodeType = mappingDescriptor.getClassNameForNodeType(nodeType);
>>return Class.forName(classNameForNodeType);
>>} catch (ClassNotFoundException e) {
>>throw new JcrMappingException("Class of name: " + classNameForNodeType +
>>" is not found" );
>>}
>>}
>>
>>Christophe Lombart wrote:
>>
>>    
>>
>>>Hi all,
>>>
>>>I just commited some code refactoring.
>>>Can you vote for the PersistenceManager API & the Mapper API ?
>>>We can expect to see some modification on thoses components when we
>>>will add new features.
>>>
>>>See on :
>>>* org.apache.portals.graffito.jcr.persistence.PersistenceManager
>>>* org.apache.portals.graffito.jcr.mapper.Mapper.
>>>
>>>You can also check the current impletation. Let me know what you want to do.
>>>I'm currently reviewing (for the secon time :-) the collection management.
>>>
>>>
>>>Christophe
>>>
>>>
>>>
>>>
>>>      
>>>
>>--
>>Mgr. Martin Kočí
>>---------------------------------
>>AURA, s.r.o.
>>Úvoz 499/56; 602 00 Brno
>>ISO 9001 certifikovaná společnost
>>tel./fax: +420 5 43 24 51 11
>>e-mail:  martin.koci@aura.cz
>>internet: http://www.aura.cz
>>         http://www.j2ee.cz
>>---------------------------------
>>
>>
>>    
>>


-- 
Mgr. Martin Kočí
---------------------------------
AURA, s.r.o.
Úvoz 499/56; 602 00 Brno
ISO 9001 certifikovaná společnost
tel./fax: +420 5 43 24 51 11
e-mail:  martin.koci@aura.cz
internet: http://www.aura.cz
         http://www.j2ee.cz
--------------------------------- 


Mime
View raw message