From graffito-dev-return-176-apmail-incubator-graffito-dev-archive=www.apache.org@incubator.apache.org Sun Apr 10 21:16:05 2005 Return-Path: Delivered-To: apmail-incubator-graffito-dev-archive@www.apache.org Received: (qmail 21910 invoked from network); 10 Apr 2005 21:16:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Apr 2005 21:16:05 -0000 Received: (qmail 47723 invoked by uid 500); 10 Apr 2005 21:16:05 -0000 Mailing-List: contact graffito-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: graffito-dev@incubator.apache.org Delivered-To: mailing list graffito-dev@incubator.apache.org Delivered-To: moderator for graffito-dev@incubator.apache.org Received: (qmail 44141 invoked by uid 99); 10 Apr 2005 21:05:03 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Message-ID: <1113167112.425995080f2d2@mail.inovex.de> Date: Sun, 10 Apr 2005 23:05:12 +0200 From: sboehme@inovex.de To: graffito-dev@incubator.apache.org Subject: RE: JCR mapping // proof of concept References: <1F7418B606BBE4478D5C5CA8D81D7CB902C161@bxl-exchange.bxl.cronos-technologies.com> In-Reply-To: <1F7418B606BBE4478D5C5CA8D81D7CB902C161@bxl-exchange.bxl.cronos-technologies.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-Originating-IP: 84.163.253.47 X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello, to Christophe and Oliver I sent (hopefully all) the files for a proof of concept of three usecases for the JCR Mapping(I could not sent it to the mailing list because it does not allow attachments): 1. Registering custom nodetypes according to a Java Bean model. 2. Persist a Java Bean. 3. Loading a Java Bean from the repository. ==>1. Creating the custom nodetypes is realized with JAXB. The BeanConverter class maps the Java structure to the nodetype structure and marshalls the custom_nodetypes.xml to the configured nodetype folder. I attached the /lib folder with the jaxb libraries, a XML schema and the command line call (in the generateNodeTypeDTD.bat file) if somebody want to generate a new custom_nodetypes.xml file. I did not check the schema against the spec yet, because it will change anyway. Once the definition of the custom_nodetypes.xml file is stable, I would like to create an Ant target and a seperate library for generating custom nodetypes out of Java Beans. ==>2. Persisting simply works like that: PersistenceManager pm = new PersistenceManager(session); String relPath = pm.insert(folder); ==>3. Loading can be implemented this way: Folder loadedFolder = (Folder) pm.getObject(relPath); All information for reading and writing a bean can be gained by the class itself except the path where the object is stored in the repository. This path acts like a unambiguous database id. ++ limitations ++ o no complex properties can be saved (Folder.getDocument()) o collections are not yet supported o deletion is not yet supported o only the basic JCR Types (String, boolean,...) and java.util.Date are supported o the bean converter is not yet adapted to Graffito converter handling o mixin's/Interfaces are not yet supported ++ next steps ++ o much more test cases need to be added and I'm sure according bug's need to be fixed ;-) o also delete the data created in the test cases o pm.update and pm.delete() need to be added o more atomic types (like Character,...) need to be added o support for complex types o support for collections o support for interfaces o make the namespace "graffito" configurable o support for JCR features like searching, versioning,... o creating an Ant target for registering Java classes as nodetypes o refactor some responsibilties and names of some classes o ... ++ configuration ++ I don't think it is ready for check in because the configuration is not very clean at the moment. I needed to delete the repository data (repotest/versions and repotest/workspaces/default) in order to get the tests to run. I've not very much experience with maven. Your information for this issue are very much appreciated. Please tell me your opinions about all this. Thank you very much. Regards, Sandro Zitat von LOMBART Christophe : > No problem. I'm working on other area. > > Christophe > > > -----Original Message----- > From: Sandro B�hme [mailto:s.boehme@inovex.de] > Sent: Tue 4/5/2005 9:17 AM > To: graffito-dev@incubator.apache.org > Cc: > Subject: Re: JCR mapping - step 2 > Hallo again, > > getting Graffito to run needed a little bit more time than I expected. > What I have at the moment is not yet ready. But I hope I will have > something until the end of the week. > > regards, > > Sandro > > Sandro B�hme wrote: > > Hello, > > > > Christophe Lombart wrote: > > > >> Hi all, > >> > >> I commited a small prototype (basic foundation to work together) for > >> the JCR mapping framework. See in the jcr-mapping subproject. > >> > >> Currently, it works like this : > >> * There is a converter class/cms object registered in a config file > >> (see a example in jcr-mapping\src\conf\convertertest\converters.xml). > >> This config file is very simple for this prototype. > >> * A simple converter class can be found in > >> org.apache.portals.graffito.jcr.testconverter. > >> * It is possible to use custom JCR nodetypes or unstructured nodes. > >> This prototype is based on a node type called "graffito:folder" > >> * Check the > >> > jcr-mapping/src/test/org/apache/portals/graffito/jcr/session/impl/JcrSessionTest.java > > >> to get more info > >> > >> What about the next step ? I think the following steps should be > >> interesting : > >> * Add search capabilities > >> * More unit tests > >> * Build a more generic converter class. I'm thinking about a more > >> advanced config file. Something like : > >> > >> >> > converterClass="org.apache.portals.graffito.jcr.converter.GenericConverter" > >> nodetype="graffito:folder" > > >> > >> > >> > >> > >> > >> .... > >> > >> > >> > >> * Any volonteer to continue this work ? Again, the code is still a > > > > yes, I would like to create a bean converter class at the weekend. > > > > Regards, > > > > Sandro > > > >> *prototype* and you are welcome to send us patches, comments, new > >> enhancements, ... I'm going to create a new component in JIRA. > > > > > >> > >> Thanks, > >> Christophe > >> > >> > > > > > > > >