From graffito-commits-returndhernandez@example.net Mon Jun 12 22:16:46 2006 Return-Path: <graffito-commits-returndhernandez@example.net> Delivered-To: dhernandez@example.net Received: (qmail 27069 invoked from network); 12 Jun 2006 22:16:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Jun 2006 22:16:45 -0000 Received: (qmail 52234 invoked by uid 500); 12 Jun 2006 22:16:45 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <graffito-commits.incubator.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 52223 invoked by uid 99); 12 Jun 2006 22:16:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2006 15:16:45 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2006 15:16:44 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id BCA7E1A983A; Mon, 12 Jun 2006 15:16:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r413756 - /incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/query/PersistenceManagerScopeQueryTest.java Date: Mon, 12 Jun 2006 22:16:24 -0000 To: dhernandez@example.net From: dhernandez@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <dhernandez@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clombart Date: Mon Jun 12 15:16:23 2006 New Revision: 413756 URL: http://svn.apache.org/viewvc?rev=413756&view=rev Log: Modify a unit test Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/query/PersistenceManagerScopeQueryTest.java Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/query/PersistenceManagerScopeQueryTest.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/query/PersistenceManagerScopeQueryTest.java?rev=413756&r1=413755&r2=413756&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/query/PersistenceManagerScopeQueryTest.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/query/PersistenceManagerScopeQueryTest.java Mon Jun 12 15:16:23 2006 @@ -144,6 +144,16 @@ result = persistenceManager.getObjects(query); assertTrue("Invalid number of objects - should be = 4", result.size() == 4); + queryManager = this.getQueryManager(); + filter = queryManager.createFilter(Page.class); + filter.setScope("/test/node1/"); + query = queryManager.createQuery(filter); + persistenceManager = this.getPersistenceManager(); + result = persistenceManager.getObjects(query); + assertTrue("Invalid number of objects - should be = 2", result.size() == 2); + assertTrue ("Invalid object in the collection" , this.contains(result, "/test/node1/page1", Page.class)); + assertTrue ("Invalid object in the collection" , this.contains(result, "/test/node1/page2", Page.class)); + } catch (Exception e) { From graffito-commits-returndhernandez@example.net Mon Jun 12 22:18:39 2006 Return-Path: <graffito-commits-returndhernandez@example.net> Delivered-To: dhernandez@example.net Received: (qmail 27261 invoked from network); 12 Jun 2006 22:18:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Jun 2006 22:18:38 -0000 Received: (qmail 55382 invoked by uid 500); 12 Jun 2006 22:18:32 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <graffito-commits.incubator.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 55345 invoked by uid 99); 12 Jun 2006 22:18:31 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2006 15:18:31 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2006 15:18:29 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 237F91A9842; Mon, 12 Jun 2006 15:18:09 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r413758 - in /incubator/graffito/trunk/jcr/jcr-mapping/src: java/org/apache/portals/graffito/jcr/mapper/impl/ java/org/apache/portals/graffito/jcr/persistence/impl/ java/org/apache/portals/graffito/jcr/repository/ test/org/apache/portals/gr... Date: Mon, 12 Jun 2006 22:18:07 -0000 To: dhernandez@example.net From: dhernandez@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <dhernandez@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clombart Date: Mon Jun 12 15:18:06 2006 New Revision: 413758 URL: http://svn.apache.org/viewvc?rev=413758&view=rev Log: Now, the buildMapper is called in each constructor. This will be easier for the Spring support Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java?rev=413758&r1=413757&r2=413758&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java Mon Jun 12 15:18:06 2006 @@ -62,6 +62,7 @@ */ public DigesterMapperImpl(String xmlFile) { this.mappingFiles = new String[] { xmlFile }; + this.buildMapper(); } /** @@ -72,6 +73,7 @@ */ public DigesterMapperImpl(String[] files) { this.mappingFiles = files; + this.buildMapper(); } /** @@ -81,6 +83,7 @@ */ public DigesterMapperImpl(InputStream stream) { this.mappingStreams = new InputStream[] { stream }; + this.buildMapper(); } /** @@ -91,6 +94,7 @@ */ public DigesterMapperImpl(InputStream[] streams) { this.mappingStreams = streams; + this.buildMapper(); } /** @@ -100,6 +104,7 @@ */ public void setMappingFile(String file) { setMappingFiles(new String[] { file }); + this.buildMapper(); } /** @@ -122,7 +127,7 @@ this.descriptorReader = reader; } - public Mapper buildMapper() { + private Mapper buildMapper() { if (this.descriptorReader == null) { this.descriptorReader = new DigesterDescriptorReader(); } Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java?rev=413758&r1=413757&r2=413758&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java Mon Jun 12 15:18:06 2006 @@ -117,7 +117,7 @@ public PersistenceManagerImpl(Session session,String[] xmlMappingFiles ) { this.session = session; - this.mapper = new DigesterMapperImpl(xmlMappingFiles).buildMapper(); + this.mapper = new DigesterMapperImpl(xmlMappingFiles); DefaultAtomicTypeConverterProvider converterProvider = new DefaultAtomicTypeConverterProvider(); Map atomicTypeConverters = converterProvider.getAtomicTypeConverters(); this.queryManager = new QueryManagerImpl(mapper, atomicTypeConverters); Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java?rev=413758&r1=413757&r2=413758&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java Mon Jun 12 15:18:06 2006 @@ -44,11 +44,11 @@ /** Graffito namespace prefix constant. */ - private static final String GRAFFITO_NAMESPACE_PREFIX = "graffito"; + public static final String GRAFFITO_NAMESPACE_PREFIX = "graffito"; /** Graffito namespace constant. */ - private static final String GRAFFITO_NAMESPACE = "http://incubator.apache.org/graffito"; + public static final String GRAFFITO_NAMESPACE = "http://incubator.apache.org/graffito"; /** Item path separator */ public static final String PATH_SEPARATOR = "/"; Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java?rev=413758&r1=413757&r2=413758&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java Mon Jun 12 15:18:06 2006 @@ -198,7 +198,7 @@ session = RepositoryUtil.login(repository, "superuser", "superuser"); - mapper = new DigesterMapperImpl(files).buildMapper(); + mapper = new DigesterMapperImpl(files); converterProvider = new DefaultAtomicTypeConverterProvider(); Map atomicTypeConverters = converterProvider.getAtomicTypeConverters(); queryManager = new QueryManagerImpl(mapper, atomicTypeConverters); Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java?rev=413758&r1=413757&r2=413758&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java Mon Jun 12 15:18:06 2006 @@ -69,8 +69,8 @@ try { Mapper mapper = new DigesterMapperImpl( - "./src/test-config/jcrmapping-testmappings.xml") - .buildMapper(); + "./src/test-config/jcrmapping-testmappings.xml"); + assertNotNull("Mapper is null", mapper); ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(A.class); @@ -106,7 +106,7 @@ public void testDiscriminatorSetting() { try { - Mapper mapper = new DigesterMapperImpl("./src/test-config/jcrmapping-testmappings.xml").buildMapper(); + Mapper mapper = new DigesterMapperImpl("./src/test-config/jcrmapping-testmappings.xml"); assertNotNull("Mapper is null", mapper); ClassDescriptor classDescriptor = mapper.getClassDescriptorByNodeType("graffito:C"); @@ -126,7 +126,7 @@ public void testMapperOptionalProperties() { try { Mapper mapper = new DigesterMapperImpl( - "./src/test-config/jcrmapping.xml").buildMapper(); + "./src/test-config/jcrmapping.xml"); assertNotNull("Mapper is null", mapper); ClassDescriptor classDescriptor = mapper @@ -199,7 +199,7 @@ "./src/test-config/jcrmapping-beandescriptor.xml", "./src/test-config/jcrmapping-inheritance.xml" }; - Mapper mapper = new DigesterMapperImpl(files).buildMapper(); + Mapper mapper = new DigesterMapperImpl(files); assertNotNull("Mapper is null", mapper); @@ -296,7 +296,7 @@ "./src/test-config/jcrmapping-inheritance.xml" }; // String[] files = { "./src/test-config/jcrmapping-inheritance.xml"}; - Mapper mapper = new DigesterMapperImpl(files).buildMapper(); + Mapper mapper = new DigesterMapperImpl(files); assertNotNull("Mapper is null", mapper); @@ -357,7 +357,7 @@ public void testInterfaceWithDiscriminator() { try { String[] files = {"./src/test-config/jcrmapping-inheritance.xml"}; - Mapper mapper = new DigesterMapperImpl(files).buildMapper(); + Mapper mapper = new DigesterMapperImpl(files); assertNotNull("Mapper is null", mapper); ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(Interface.class); @@ -397,7 +397,7 @@ { try { String[] files = {"./src/test-config/jcrmapping-inheritance.xml"}; - Mapper mapper = new DigesterMapperImpl(files).buildMapper(); + Mapper mapper = new DigesterMapperImpl(files); assertNotNull("Mapper is null", mapper); ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(CmsObject.class); @@ -449,8 +449,7 @@ try { String[] files = { "./src/test-config/jcrmapping-proxy.xml" }; - Mapper mapper = new DigesterMapperImpl(files).buildMapper(); - + Mapper mapper = new DigesterMapperImpl(files); assertNotNull("Mapper is null", mapper); ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(Main.class); Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java?rev=413758&r1=413757&r2=413758&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java Mon Jun 12 15:18:06 2006 @@ -159,7 +159,7 @@ session = RepositoryUtil.login(repository, "superuser", "superuser"); - mapper = new DigesterMapperImpl(files).buildMapper(); + mapper = new DigesterMapperImpl(files); converterProvider = new DefaultAtomicTypeConverterProvider(); Map atomicTypeConverters = converterProvider.getAtomicTypeConverters(); queryManager = new QueryManagerImpl(mapper, atomicTypeConverters); Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java?rev=413758&r1=413757&r2=413758&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java (original) +++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java Mon Jun 12 15:18:06 2006 @@ -224,7 +224,7 @@ session = RepositoryUtil.login(repository, "superuser", "superuser"); - mapper = new DigesterMapperImpl(files).buildMapper(); + mapper = new DigesterMapperImpl(files); converterProvider = new DefaultAtomicTypeConverterProvider(); Map atomicTypeConverters = converterProvider.getAtomicTypeConverters(); queryManager = new QueryManagerImpl(mapper, atomicTypeConverters); From graffito-commits-returndhernandez@example.net Wed Jun 14 19:28:07 2006 Return-Path: <graffito-commits-returndhernandez@example.net> Delivered-To: dhernandez@example.net Received: (qmail 86703 invoked from network); 14 Jun 2006 19:28:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Jun 2006 19:28:07 -0000 Received: (qmail 23654 invoked by uid 500); 14 Jun 2006 19:27:51 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <graffito-commits.incubator.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 23442 invoked by uid 99); 14 Jun 2006 19:27:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:27:47 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:09:10 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 827E21A9842; Wed, 14 Jun 2006 12:08:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r414355 - in /incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring: JackrabbitSessionFactory.java JcrMappingCallback.java JcrMappingOperations.java JcrMappingTemplate.java MappingDescriptorFactoryBean.java Date: Wed, 14 Jun 2006 19:08:49 -0000 To: dhernandez@example.net From: dhernandez@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <dhernandez@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clombart Date: Wed Jun 14 12:08:49 2006 New Revision: 414355 URL: http://svn.apache.org/viewvc?rev=414355&view=rev Log: Review OCM/JCR Spring support Added: incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JackrabbitSessionFactory.java incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingCallback.java incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingOperations.java incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingTemplate.java incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/MappingDescriptorFactoryBean.java Added: incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JackrabbitSessionFactory.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JackrabbitSessionFactory.java?rev=414355&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JackrabbitSessionFactory.java (added) +++ incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JackrabbitSessionFactory.java Wed Jun 14 12:08:49 2006 @@ -0,0 +1,71 @@ +/* ======================================================================== + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== + */ +package org.apache.portals.graffito.jcr.spring; + +import javax.jcr.RepositoryException; +import javax.jcr.Session; + +import org.apache.portals.graffito.jcr.repository.RepositoryUtil; +import org.springmodules.jcr.JcrSessionFactory; + +/** + * JCR session factory specific to Jaclrabbit for Graffito. Until now, Jackrabbit cannot unregister a namespace. + * So, the JcrSessionFactory provided by the spring module is not usefull when namespace management are needed. + * This class extends the JcrSessionFactory in order to add the namespace graffito + * + * @author <a href="mailto:dhernandez@example.net">Christophe Lombart</a> + */ +public class JackrabbitSessionFactory extends JcrSessionFactory +{ + + /** + * Register the namespaces. + * + * @param session + * @throws RepositoryException + */ + protected void registerNamespaces() throws RepositoryException { + + Session session = getSession(); + try + { + String[] jcrNamespaces = session.getWorkspace().getNamespaceRegistry().getPrefixes(); + boolean createGraffitoNamespace = true; + for (int i = 0; i < jcrNamespaces.length; i++) + { + if (jcrNamespaces[i].equals(RepositoryUtil.GRAFFITO_NAMESPACE_PREFIX)) + { + createGraffitoNamespace = false; + + } + } + + if (createGraffitoNamespace) + { + session.getWorkspace().getNamespaceRegistry().registerNamespace(RepositoryUtil.GRAFFITO_NAMESPACE_PREFIX,RepositoryUtil.GRAFFITO_NAMESPACE); + } + + } + catch (Exception e) + { + throw new RepositoryException(e.getMessage()); + } + + super.registerNamespaces(); + } + +} Added: incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingCallback.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingCallback.java?rev=414355&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingCallback.java (added) +++ incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingCallback.java Wed Jun 14 12:08:49 2006 @@ -0,0 +1,35 @@ +/** + * Created on Oct 3, 2005 + * + * $Id$ + * $Revision$ + */ +package org.apache.portals.graffito.jcr.spring; + +import org.apache.portals.graffito.jcr.exception.JcrMappingException; +import org.apache.portals.graffito.jcr.persistence.PersistenceManager; + +/** + * Callback interface for Jcr mapping code. To be used with JcrMappingTemplate's execute method, + * assumably often as anonymous classes within a method implementation. The typical + * implementation will call PersistenceManager.get/insert/remove/update to perform some operations on + * the repository. + * + * @author Costin Leau + * + */ +public interface JcrMappingCallback { + + /** + * Called by {@link JcrMappingTemplate#execute} within an active PersistenceManager + * {@link org.apache.graffito.jcr.mapper.persistence.PersistenceManager}. + * It is not responsible for logging out of the <code>Session</code> or handling transactions. + * + * Allows for returning a result object created within the + * callback, i.e. a domain object or a collection of domain + * objects. A thrown {@link RuntimeException} is treated as an + * application exeception; it is propagated to the caller of the + * template. + */ + public Object doInJcrMapping(PersistenceManager manager) throws JcrMappingException; +} Added: incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingOperations.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingOperations.java?rev=414355&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingOperations.java (added) +++ incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingOperations.java Wed Jun 14 12:08:49 2006 @@ -0,0 +1,55 @@ +package org.apache.portals.graffito.jcr.spring; + +import java.util.Collection; + +import org.apache.portals.graffito.jcr.query.Query; +import org.springframework.dao.DataAccessException; + +/** + * Interface that specifies a basic set of JCR mapping operations. Not often used, but + * a useful option to enhance testability, as it can easily be mocked or stubbed. + * + * <p> + * Provides JcrMappingTemplate's data access methods that mirror various PersistenceManager + * methods. See the required javadocs for details on those methods. + * + * @author Costin Leau + * + */ +public interface JcrMappingOperations { + + /** + * Execute a JcrMappingCallback. + * + * @param callback callback to execute + * @return the callback result + * @throws DataAccessException + */ + public Object execute(JcrMappingCallback callback) throws DataAccessException; + + /** + * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#insert(java.lang.String, java.lang.Object) + */ + public void insert( final java.lang.Object object); + + /** + * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#update(java.lang.String, java.lang.Object) + */ + public void update( final java.lang.Object object); + + /** + * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#remove(java.lang.String) + */ + public void remove(final java.lang.String path); + + /** + * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#getObject(java.lang.Class, java.lang.String) + */ + public Object getObject( final java.lang.String path); + + /** + * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#getObjects(org.apache.portals.graffito.jcr.query.Query) + */ + public Collection getObjects(final Query query); + +} \ No newline at end of file Added: incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingTemplate.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingTemplate.java?rev=414355&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingTemplate.java (added) +++ incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/JcrMappingTemplate.java Wed Jun 14 12:08:49 2006 @@ -0,0 +1,267 @@ +/** + * Created on Oct 2, 2005 + * + * $Id$ + * $Revision$ + */ +package org.apache.portals.graffito.jcr.spring; + +import java.io.InputStream; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import javax.jcr.RepositoryException; +import javax.jcr.Session; + +import org.apache.portals.graffito.jcr.exception.JcrMappingException; +import org.apache.portals.graffito.jcr.mapper.Mapper; +import org.apache.portals.graffito.jcr.persistence.PersistenceManager; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.BinaryTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.BooleanTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.ByteArrayTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.CalendarTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.DoubleTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.IntTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.LongTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.StringTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.TimestampTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.UtilDateTypeConverterImpl; +import org.apache.portals.graffito.jcr.persistence.impl.PersistenceManagerImpl; +import org.apache.portals.graffito.jcr.query.Query; +import org.apache.portals.graffito.jcr.query.QueryManager; +import org.apache.portals.graffito.jcr.query.impl.QueryManagerImpl; +import org.springframework.dao.DataAccessException; +import org.springmodules.jcr.JcrCallback; +import org.springmodules.jcr.JcrSystemException; +import org.springmodules.jcr.JcrTemplate; +import org.springmodules.jcr.SessionFactory; + +/** + * Template whichs adds mapping support for the Java Content Repository. + * <p/> + * For PersistenceManagers the template creates internally the set of default converters. + * + * + * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager + * @author Costin Leau + * + */ +public class JcrMappingTemplate extends JcrTemplate implements JcrMappingOperations { + + private Mapper mapper; + + + /** + * Default constructor for JcrTemplate + */ + public JcrMappingTemplate() { + super(); + + } + + /** + * @param sessionFactory + */ + public JcrMappingTemplate(SessionFactory sessionFactory, Mapper mapper) { + setSessionFactory(sessionFactory); + setMapper(mapper); + + afterPropertiesSet(); + } + + /** + * Add rule for checking the mapper. + * + * @see org.springmodules.jcr.JcrAccessor#afterPropertiesSet() + */ + public void afterPropertiesSet() { + super.afterPropertiesSet(); + if (mapper == null) + throw new IllegalArgumentException("mapper can NOT be null"); + } + + /** + * Method for creating a query manager. It's unclear where this entity is stateless or not. + * + * @return + */ + public QueryManager createQueryManager() { + try + { + Map atomicTypeConverters = this.createDefaultConverters(this.getSession()); + return new QueryManagerImpl (mapper, atomicTypeConverters); + } + catch (RepositoryException e) + { + throw new JcrSystemException(e); + } + } + + /** + * Creates a persistence manager. It's unclear if this object is stateless/thread-safe or not. + * However because it depends on session it has to be created per session and it's not per repository. + * + * + * @param session + * @return + * @throws JcrMappingException + */ + protected PersistenceManager createPersistenceManager(Session session) throws RepositoryException, JcrMappingException { + return new PersistenceManagerImpl(mapper, createQueryManager(), session); + } + + /** + * Due to the way the actual jcr-mapping is made we have to create the converters for + * each session. + * + * @param session + * @return + */ + protected Map createDefaultConverters(Session session) throws RepositoryException { + Map map = new HashMap(14); + + map.put(String.class, new StringTypeConverterImpl()); + map.put(InputStream.class, new BinaryTypeConverterImpl()); + map.put(long.class, new LongTypeConverterImpl()); + map.put(Long.class, new LongTypeConverterImpl()); + map.put(int.class, new IntTypeConverterImpl()); + map.put(Integer.class, new IntTypeConverterImpl()); + map.put(double.class, new DoubleTypeConverterImpl()); + map.put(Double.class, new DoubleTypeConverterImpl()); + map.put(boolean.class, new BooleanTypeConverterImpl()); + map.put(Boolean.class, new BooleanTypeConverterImpl()); + map.put(Calendar.class, new CalendarTypeConverterImpl()); + map.put(Date.class, new UtilDateTypeConverterImpl()); + map.put(byte[].class, new ByteArrayTypeConverterImpl()); + map.put(Timestamp.class, new TimestampTypeConverterImpl()); + + return map; + } + + /** + * @see org.springmodules.jcr.mapping.JcrMappingOperations#execute(org.springmodules.jcr.mapping.JcrMappingCallback, boolean) + */ + public Object execute(final JcrMappingCallback action, boolean exposeNativeSession) throws DataAccessException { + return execute(new JcrCallback() { + /** + * @see org.springmodules.jcr.JcrCallback#doInJcr(javax.jcr.Session) + */ + public Object doInJcr(Session session) throws RepositoryException { + try { + return action.doInJcrMapping(createPersistenceManager(session)); + } catch (JcrMappingException e) { + throw convertMappingAccessException(e); + } + } + + }, exposeNativeSession); + } + + /** + * @see org.springmodules.jcr.mapping.JcrMappingOperations#execute(org.springmodules.jcr.mapping.JcrMappingCallback) + */ + public Object execute(JcrMappingCallback callback) throws DataAccessException { + return execute(callback, isExposeNativeSession()); + } + + // ---------------- + // Delegate methods + // ---------------- + + /** + * @see org.springmodules.jcr.mapping.JcrMappingOperations#insert(java.lang.String, java.lang.Object) + */ + public void insert(final java.lang.Object object) { + execute(new JcrMappingCallback() { + public Object doInJcrMapping(PersistenceManager manager) throws JcrMappingException { + manager.insert(object); + return null; + } + }, true); + } + + /** + * @see org.springmodules.jcr.mapping.JcrMappingOperations#update(java.lang.String, java.lang.Object) + */ + public void update( final java.lang.Object object) { + execute(new JcrMappingCallback() { + public Object doInJcrMapping(PersistenceManager manager) throws JcrMappingException { + manager.update( object); + return null; + } + }, true); + } + + /** + * @see org.springmodules.jcr.mapping.JcrMappingOperations#remove(java.lang.String) + */ + public void remove(final java.lang.String path) { + execute(new JcrMappingCallback() { + public Object doInJcrMapping(PersistenceManager manager) throws JcrMappingException { + manager.remove(path); + return null; + } + }, true); + } + + /** + * @see org.springmodules.jcr.mapping.JcrMappingOperations#getObject(java.lang.Class, java.lang.String) + */ + public Object getObject(final java.lang.String path) { + return execute(new JcrMappingCallback() { + public Object doInJcrMapping(PersistenceManager manager) throws JcrMappingException { + return manager.getObject(path); + } + }, true); + } + + /** + * @see org.springmodules.jcr.mapping.JcrMappingOperations#getObjects(org.apache.portals.graffito.jcr.query.Query) + */ + public Collection getObjects(final Query query) { + return (Collection) execute(new JcrMappingCallback() { + public Object doInJcrMapping(PersistenceManager manager) throws JcrMappingException { + return manager.getObjects(query); + } + }, true); + } + + /** + * Convert the given MappingException to an appropriate exception from + * the <code>org.springframework.dao</code> hierarchy. + * <p> + * Note that because we have no base specific exception we have to catch + * the generic Exception and translate it into JcrSystemException. + * <p> + * May be overridden in subclasses. + * + * @param ex Exception that occured + * @return the corresponding DataAccessException instance + */ + public DataAccessException convertMappingAccessException(Exception ex) { + // repository exception + if (ex instanceof RepositoryException) + return super.convertJcrAccessException((RepositoryException) ex); + return new JcrSystemException(ex); + } + + /** + * @return Returns the mapper. + */ + public Mapper getMapper() { + return mapper; + } + + /** + * @param mapper The mapper to set. + */ + public void setMapper(Mapper mapper) { + this.mapper = mapper; + } + + +} Added: incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/MappingDescriptorFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/MappingDescriptorFactoryBean.java?rev=414355&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/MappingDescriptorFactoryBean.java (added) +++ incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/MappingDescriptorFactoryBean.java Wed Jun 14 12:08:49 2006 @@ -0,0 +1,103 @@ +/** + * Created on Oct 2, 2005 + * + * $Id$ + * $Revision$ + */ +package org.apache.portals.graffito.jcr.spring; + +import java.io.IOException; +import java.util.Iterator; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.portals.graffito.jcr.exception.JcrMappingException; +import org.apache.portals.graffito.jcr.mapper.impl.DigesterDescriptorReader; +import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor; +import org.apache.portals.graffito.jcr.mapper.model.MappingDescriptor; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.core.io.Resource; + +/** + * Factory bean for loading mapping files. This factory beans can load several file descriptors + * and assembles them into an overall class descriptor. + * + * @author Costin Leau + * + */ +public class MappingDescriptorFactoryBean implements FactoryBean, InitializingBean { + + private static final Log log = LogFactory.getLog(MappingDescriptorFactoryBean.class); + + private MappingDescriptor mappingDescriptor; + + private Resource[] mappings; + + /** + * @see org.springframework.beans.factory.FactoryBean#getObject() + */ + public Object getObject() throws Exception { + return mappingDescriptor; + } + + /** + * @see org.springframework.beans.factory.FactoryBean#getObjectType() + */ + public Class getObjectType() { + return (this.mappingDescriptor != null) ? this.mappingDescriptor.getClass() : ClassDescriptor.class; + } + + /** + * @see org.springframework.beans.factory.FactoryBean#isSingleton() + */ + public boolean isSingleton() { + return true; + } + + /** + * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() + */ + public void afterPropertiesSet() throws Exception { + if (mappings == null || mappings.length == 0) + throw new IllegalArgumentException("at least one mapping file is needed"); + + createMappingDescriptor(); + } + + /** + * Subclasses can extend this method to provide custom behavior when creating + * the mapping descriptor + */ + protected void createMappingDescriptor() throws IOException, JcrMappingException { + // load the descriptors step by step and concatenate everything in an over-all + // descriptor + DigesterDescriptorReader reader = new DigesterDescriptorReader(); + mappingDescriptor = reader.loadClassDescriptors(mappings[0].getInputStream()); + boolean debug = log.isDebugEnabled(); + + for (int i = 1; i < mappings.length; i++) { + if (mappings[i] != null) { + MappingDescriptor descriptor = reader.loadClassDescriptors(mappings[i].getInputStream()); + for (Iterator iter = descriptor.getClassDescriptorsByClassName().values().iterator(); iter.hasNext();) { + mappingDescriptor.addClassDescriptor((ClassDescriptor) iter.next()); + } + } + } + } + + /** + * @return Returns the descriptors. + */ + public Resource[] getMappings() { + return mappings; + } + + /** + * @param descriptors The descriptors to set. + */ + public void setMappings(Resource[] descriptors) { + this.mappings = descriptors; + } + +} From graffito-commits-returndhernandez@example.net Wed Jun 14 19:28:11 2006 Return-Path: <graffito-commits-returndhernandez@example.net> Delivered-To: dhernandez@example.net Received: (qmail 86917 invoked from network); 14 Jun 2006 19:28:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Jun 2006 19:28:10 -0000 Received: (qmail 24701 invoked by uid 500); 14 Jun 2006 19:28:06 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <graffito-commits.incubator.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 23758 invoked by uid 99); 14 Jun 2006 19:27:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:27:53 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:10:13 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 09D491A983E; Wed, 14 Jun 2006 12:09:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r414357 - in /incubator/graffito/trunk/jcr/spring/src/spring-config: ./ applicationContext-jr-jca.xml applicationContext-jr-local.xml applicationContext-repository.xml Date: Wed, 14 Jun 2006 19:09:52 -0000 To: dhernandez@example.net From: dhernandez@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <dhernandez@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clombart Date: Wed Jun 14 12:09:51 2006 New Revision: 414357 URL: http://svn.apache.org/viewvc?rev=414357&view=rev Log: Review OCM/JCR support Added: incubator/graffito/trunk/jcr/spring/src/spring-config/ incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-jca.xml (with props) incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-local.xml (with props) incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-repository.xml (contents, props changed) - copied, changed from r408764, incubator/graffito/trunk/jcr/spring/conf/applicationContext-repository.xml Added: incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-jca.xml URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-jca.xml?rev=414357&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-jca.xml (added) +++ incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-jca.xml Wed Jun 14 12:09:51 2006 @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" + "http://www.springframework.org/dtd/spring-beans.dtd"> +<!-- + JCA configuration only for JackRabbit. This examples uses Jenks. + + $Id: applicationContext-jr-jca.xml,v 1.1 2005/10/10 09:20:43 costin Exp $ + --> +<beans> + + <!-- Transaction manager configuration for Jenks --> + + <bean id="connectionTracker" + class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator"/> + + <bean id="transactionManagerImpl" + class="org.jencks.factory.TransactionManagerFactoryBean"> + <property name="defaultTransactionTimeoutSeconds"> + <value>600</value> + </property> + <property name="transactionLog"> + <bean class="org.apache.geronimo.transaction.log.UnrecoverableLog"/> + </property> + </bean> + + <bean id="transactionContextManager" + class="org.jencks.factory.TransactionContextManagerFactoryBean"> + <property name="transactionManager"> + <ref local="transactionManagerImpl"/> + </property> + </bean> + + <bean id="userTransaction" + class="org.jencks.factory.UserTransactionFactoryBean"> + <property name="transactionContextManager"> + <ref local="transactionContextManager"/> + </property> + <property name="connectionTrackingCoordinator"> + <ref local="connectionTracker"/> + </property> + </bean> + + <bean id="transactionContextInitializer" + class="org.jencks.interceptor.TransactionContextInitializer"> + <property name="associator"> + <ref local="connectionTracker"/> + </property> + </bean> + + <!-- JCA configuration --> + <bean id="transactionSupport" + class="org.jencks.factory.XATransactionFactoryBean"> + <property name="useTransactionCaching"> + <value>true</value> + </property> + <property name="useThreadCaching"> + <value>false</value> + </property> + </bean> + + <bean id="poolingSupport" class="org.jencks.factory.SinglePoolFactoryBean"> + <property name="maxSize"> + <value>2</value> + </property> + <property name="minSize"> + <value>1</value> + </property> + <property name="blockingTimeoutMilliseconds"> + <value>60</value> + </property> + <property name="idleTimeoutMinutes"> + <value>60</value> + </property> + <property name="matchOne"> + <value>true</value> + </property> + <property name="matchAll"> + <value>true</value> + </property> + <property name="selectOneAssumeMatch"> + <value>true</value> + </property> + </bean> + + <bean id="connectionManager" + class="org.jencks.factory.ConnectionManagerFactoryBean"> + <property name="transactionSupport"> + <ref local="transactionSupport"/> + </property> + <property name="poolingSupport"> + <ref local="poolingSupport"/> + </property> + <property name="transactionContextManager"> + <ref local="transactionContextManager"/> + </property> + <property name="connectionTracker"> + <ref local="connectionTracker"/> + </property> + </bean> + + <!-- JackRabbit JCA specific configuration --> + <bean id="repositoryManagedConnectionFactory" + class="org.apache.jackrabbit.jca.JCAManagedConnectionFactory"> + <property name="homeDir"> + <value>./xa-rep</value> + </property> + <property name="configFile"> + <value>src/test-config/repository-xml.xml</value> + </property> + </bean> + + <!-- common properties --> + + <bean id="jcrTransactionManager" + class="org.springframework.transaction.jta.JtaTransactionManager"> + <property name="userTransaction"> + <ref local="userTransaction"/> + </property> + <property name="transactionManager"> + <ref local="transactionManagerImpl"/> + </property> + </bean> + + <bean id="repository" class="org.springframework.jca.support.LocalConnectionFactoryBean"> + <property name="managedConnectionFactory"><ref local="repositoryManagedConnectionFactory"/></property> + <property name="connectionManager"><ref local="connectionManager"/></property> + </bean> + + +</beans> \ No newline at end of file Propchange: incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-jca.xml ------------------------------------------------------------------------------ svn:executable = * Added: incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-local.xml URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-local.xml?rev=414357&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-local.xml (added) +++ incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-local.xml Wed Jun 14 12:09:51 2006 @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" + "http://www.springframework.org/dtd/spring-beans.dtd"> +<!-- + Local transaction manager only for JackRabbit + + $Id: applicationContext-jr-local.xml,v 1.1 2005/10/10 09:20:42 costin Exp $ + --> +<beans> + <bean id="jcrTransactionManager" + class="org.springmodules.jcr.jackrabbit.LocalTransactionManager"> + <property name="sessionFactory" ref="jcrSessionFactory"/> + </bean> + + <bean id="repository" class="org.springmodules.jcr.jackrabbit.RepositoryFactoryBean"> + <!-- normal factory beans params --> + <property name="configuration" value="src/test-config/repository-xml.xml"/> + <property name="homeDir" value="target/repository"/> + </bean> +</beans> \ No newline at end of file Propchange: incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-jr-local.xml ------------------------------------------------------------------------------ svn:executable = * Copied: incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-repository.xml (from r408764, incubator/graffito/trunk/jcr/spring/conf/applicationContext-repository.xml) URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-repository.xml?p2=incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-repository.xml&p1=incubator/graffito/trunk/jcr/spring/conf/applicationContext-repository.xml&r1=408764&r2=414357&rev=414357&view=diff ============================================================================== --- incubator/graffito/trunk/jcr/spring/conf/applicationContext-repository.xml (original) +++ incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-repository.xml Wed Jun 14 12:09:51 2006 @@ -8,54 +8,39 @@ $Id: applicationContext-repository.xml,v 1.2 2005/10/10 09:20:42 costin Exp $ --> <beans default-lazy-init="true"> + <!-- import resource="applicationContext-jr-jca.xml"/ --> + <import resource="applicationContext-jr-local.xml"/> + - - <bean id="repository" class="org.springmodules.jcr.jackrabbit.RepositoryFactoryBean"> - <!-- normal factory beans params --> - <property name="configuration" value="file:./conf/jackrabbit-repo.xml"/> - <property name="homeDir" value="./target/repository"/> - </bean> - - <bean id="jcrSessionFactory" class="org.springmodules.jcr.JcrSessionFactory"> + <bean id="jcrSessionFactory" class="org.apache.portals.graffito.jcr.spring.JackrabbitSessionFactory"> <property name="repository" ref="repository"/> <property name="credentials"> <bean class="javax.jcr.SimpleCredentials"> - <constructor-arg index="0" value="bogus"/> + <constructor-arg index="0" value="superuser"/> <!-- create the credentials using a bean factory --> <constructor-arg index="1"> <bean factory-bean="password" factory-method="toCharArray"/> </constructor-arg> - </bean> + </bean> </property> - <property name="namespaces"> - <props> - <prop key="graffito">http://incubator.apache.org/graffito</prop> - </props> - </property> - </bean> - - <bean id="jcrTransactionManager" - class="org.springmodules.jcr.jackrabbit.LocalTransactionManager"> - <property name="sessionFactory" ref="jcrSessionFactory"/> + + </bean> - + <!-- create the password to return it as a char[] --> <bean id="password" class="java.lang.String"> - <constructor-arg index="0" value="pass"/> + <constructor-arg index="0" value="superuser"/> </bean> - <bean id="providerManager" class="org.springmodules.jcr.support.ServiceSessionHolderProviderManager"/> - + <bean id="jcrMappingDescriptor" class="org.apache.portals.graffito.jcr.mapper.impl.DigesterMapperImpl"> - <constructor-arg index="0" value="./conf/jcrmapping/jcrmapping.xml"/> + <constructor-arg index="0" value="./src/test-config/jcrmapping.xml"/> </bean> - <bean id="jcrMappingTemplate" class="org.springmodules.jcr.mapping.JcrMappingTemplate"> - <property name="sessionFactory" ref="jcrSessionFactory"/> - <property name="providerManager" ref="providerManager"/> - <property name="mapper" ref="jcrMappingDescriptor"/> - <property name="allowCreate" value="true"/> + <bean id="jcrMappingTemplate" class="org.apache.portals.graffito.jcr.spring.JcrMappingTemplate"> + <constructor-arg index="0" ref="jcrSessionFactory"/> + <constructor-arg index="1" ref="jcrMappingDescriptor"/> </bean> <bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" @@ -70,19 +55,19 @@ </property> </bean> - <bean id="org.apache.portals.graffito.jcr.spring.demo.components.impl.NewsServiceImpl" - class="org.apache.portals.graffito.jcr.spring.demo.components.impl.NewsServiceImpl" > - <property name="jcrMappingTemplate" ref="jcrMappingTemplate"/> + + <bean id="org.apache.portals.graffito.jcr.spring.test.components.impl.NewsServiceImpl" + class="org.apache.portals.graffito.jcr.spring.test.components.impl.NewsServiceImpl" > + <property name="jcrMappingTemplate" ref="jcrMappingTemplate"/> </bean> - - <bean id="org.apache.portals.graffito.jcr.spring.demo.components.NewsService" parent="baseTransactionProxy" - name="org.apache.portals.graffito.jcr.spring.demo.components.NewsService" > + <bean id="org.apache.portals.graffito.jcr.spring.test.components.NewsService" parent="baseTransactionProxy" + name="org.apache.portals.graffito.jcr.spring.test.components.NewsService" > <property name="proxyInterfaces"> - <value>org.apache.portals.graffito.jcr.spring.demo.components.NewsService</value> + <value>org.apache.portals.graffito.jcr.spring.test.components.NewsService</value> </property> <property name="target"> - <ref bean="org.apache.portals.graffito.jcr.spring.demo.components.impl.NewsServiceImpl"/> + <ref bean="org.apache.portals.graffito.jcr.spring.test.components.impl.NewsServiceImpl"/> </property> <property name="transactionAttributes"> <props> @@ -90,31 +75,29 @@ <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> - </bean> - - - - <bean id="org.apache.portals.graffito.jcr.spring.demo.components.impl.ArticleServiceImpl" - class="org.apache.portals.graffito.jcr.spring.demo.components.impl.ArticleServiceImpl" > + </bean> + + <bean id="org.apache.portals.graffito.jcr.spring.test.components.impl.ArticleServiceImpl" + class="org.apache.portals.graffito.jcr.spring.test.components.impl.ArticleServiceImpl" > <property name="jcrMappingTemplate" ref="jcrMappingTemplate"/> - <property name="newsService" ref="org.apache.portals.graffito.jcr.spring.demo.components.NewsService"/> + <property name="newsService" ref="org.apache.portals.graffito.jcr.spring.test.components.NewsService"/> </bean> - - <bean id="org.apache.portals.graffito.jcr.spring.demo.components.ArticleService" parent="baseTransactionProxy" - name="org.apache.portals.graffito.jcr.spring.demo.components.ArticleService" > + <bean id="org.apache.portals.graffito.jcr.spring.test.components.ArticleService" parent="baseTransactionProxy" + name="org.apache.portals.graffito.jcr.spring.test.components.ArticleService" > <property name="proxyInterfaces"> - <value>org.apache.portals.graffito.jcr.spring.demo.components.ArticleService</value> + <value>org.apache.portals.graffito.jcr.spring.test.components.ArticleService</value> </property> <property name="target"> - <ref bean="org.apache.portals.graffito.jcr.spring.demo.components.impl.ArticleServiceImpl"/> + <ref bean="org.apache.portals.graffito.jcr.spring.test.components.impl.ArticleServiceImpl"/> </property> <property name="transactionAttributes"> <props> - + <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> - + + </beans> Propchange: incubator/graffito/trunk/jcr/spring/src/spring-config/applicationContext-repository.xml ------------------------------------------------------------------------------ svn:executable = * From graffito-commits-returndhernandez@example.net Wed Jun 14 19:28:56 2006 Return-Path: <graffito-commits-returndhernandez@example.net> Delivered-To: dhernandez@example.net Received: (qmail 87676 invoked from network); 14 Jun 2006 19:28:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Jun 2006 19:28:56 -0000 Received: (qmail 25707 invoked by uid 500); 14 Jun 2006 19:28:18 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <graffito-commits.incubator.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 25035 invoked by uid 99); 14 Jun 2006 19:28:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:28:10 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:09:44 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D54501A9844; Wed, 14 Jun 2006 12:09:23 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r414356 - in /incubator/graffito/trunk/jcr/spring/src: java/org/apache/portals/graffito/jcr/spring/demo/components/ java/org/apache/portals/graffito/jcr/spring/demo/components/impl/ java/org/apache/portals/graffito/jcr/spring/demo/model/ re... Date: Wed, 14 Jun 2006 19:09:23 -0000 To: dhernandez@example.net From: dhernandez@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <dhernandez@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clombart Date: Wed Jun 14 12:09:23 2006 New Revision: 414356 URL: http://svn.apache.org/viewvc?rev=414356&view=rev Log: Review OCM/JCR Spring support Removed: incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/demo/components/ArticleService.java incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/demo/components/NewsService.java incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/demo/components/impl/ incubator/graffito/trunk/jcr/spring/src/java/org/apache/portals/graffito/jcr/spring/demo/model/ incubator/graffito/trunk/jcr/spring/src/repository/ From graffito-commits-returndhernandez@example.net Wed Jun 14 19:30:34 2006 Return-Path: <graffito-commits-returndhernandez@example.net> Delivered-To: dhernandez@example.net Received: (qmail 88321 invoked from network); 14 Jun 2006 19:30:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Jun 2006 19:30:34 -0000 Received: (qmail 25342 invoked by uid 500); 14 Jun 2006 19:28:14 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <graffito-commits.incubator.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 24492 invoked by uid 99); 14 Jun 2006 19:28:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:28:03 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:08:38 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 154F71A983A; Wed, 14 Jun 2006 12:08:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r414354 - /incubator/graffito/trunk/jcr/spring/conf/ Date: Wed, 14 Jun 2006 19:08:17 -0000 To: dhernandez@example.net From: dhernandez@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <dhernandez@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clombart Date: Wed Jun 14 12:08:17 2006 New Revision: 414354 URL: http://svn.apache.org/viewvc?rev=414354&view=rev Log: Review OCM/JCR support Removed: incubator/graffito/trunk/jcr/spring/conf/ From graffito-commits-returndhernandez@example.net Wed Jun 14 19:43:11 2006 Return-Path: <graffito-commits-returndhernandez@example.net> Delivered-To: dhernandez@example.net Received: (qmail 98794 invoked from network); 14 Jun 2006 19:43:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Jun 2006 19:43:11 -0000 Received: (qmail 89789 invoked by uid 500); 14 Jun 2006 19:43:07 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <graffito-commits.incubator.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 89741 invoked by uid 99); 14 Jun 2006 19:43:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:43:06 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 12:43:05 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2B0551A983A; Wed, 14 Jun 2006 12:42:45 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r414365 - in /incubator/graffito/trunk/jcr/spring/src/test-config: ./ repository/ repository/repository/ repository/repository/nodetypes/ Date: Wed, 14 Jun 2006 19:42:43 -0000 To: dhernandez@example.net From: dhernandez@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <dhernandez@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clombart Date: Wed Jun 14 12:42:43 2006 New Revision: 414365 URL: http://svn.apache.org/viewvc?rev=414365&view=rev Log: Add test config Added: incubator/graffito/trunk/jcr/spring/src/test-config/ incubator/graffito/trunk/jcr/spring/src/test-config/graffito-jcr-mapping.dtd incubator/graffito/trunk/jcr/spring/src/test-config/jaas.config incubator/graffito/trunk/jcr/spring/src/test-config/jcrmapping.xml (with props) incubator/graffito/trunk/jcr/spring/src/test-config/repository/ incubator/graffito/trunk/jcr/spring/src/test-config/repository-bdb.xml incubator/graffito/trunk/jcr/spring/src/test-config/repository-derby.xml (with props) incubator/graffito/trunk/jcr/spring/src/test-config/repository-xml.xml (with props) incubator/graffito/trunk/jcr/spring/src/test-config/repository/repository/ incubator/graffito/trunk/jcr/spring/src/test-config/repository/repository/nodetypes/ incubator/graffito/trunk/jcr/spring/src/test-config/repository/repository/nodetypes/custom_nodetypes.xml (with props) Added: incubator/graffito/trunk/jcr/spring/src/test-config/graffito-jcr-mapping.dtd URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test-config/graffito-jcr-mapping.dtd?rev=414365&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test-config/graffito-jcr-mapping.dtd (added) +++ incubator/graffito/trunk/jcr/spring/src/test-config/graffito-jcr-mapping.dtd Wed Jun 14 12:42:43 2006 @@ -0,0 +1,161 @@ +<!-- +/* + * Copyright 2004-2005 The Apache Software Foundation or its licensors, + * as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> + +<!ELEMENT graffito-jcr (class-descriptor*)> + +<!ATTLIST graffito-jcr package CDATA #IMPLIED> + +<!-- + Class descriptor - Each class descriptor describes the mapping strategy used for one a java class + * className : the class name + * jcrNodeType : the primary jcr node type, it can be nt:unstructured + * jcrSuperTypes : the jcr super types, optional + * jcrMixinTypes: the jcr mixin types (comma separated list) (optional) + * extends: name of super class (optional) + * abstract: true if this class is abstract and it is used in hierarchy mappings + * discriminator true if the mapped node requires an graffito:discriminator node type. This type contains a classname property. +--> +<!ELEMENT class-descriptor (implement-descriptor*, field-descriptor*, bean-descriptor*, collection-descriptor*)> + +<!ATTLIST class-descriptor + className CDATA #REQUIRED + jcrNodeType CDATA #IMPLIED + jcrSuperTypes CDATA #IMPLIED + jcrMixinTypes CDATA #IMPLIED + extend CDATA #IMPLIED + abstract (true|false) "false" + interface (true|false) "false" + discriminator (true|false) "true" +> + +<!-- + Implement descriptor - This descriptor matches to one java interface implemented by the class descriptor + interfaceName : the full interface name +--> +<!ELEMENT implement-descriptor EMPTY> + +<!ATTLIST implement-descriptor + interfaceName CDATA #REQUIRED +> + +<!-- + Field descriptor - A field descriptor maps one atomic object attribute (primitive types, String, Long, ...) into a JCR property + * fieldName : the field/attribute name + * fieldType: the primitive type or fully qualified class name of the field (optional) + * jcrName : the jcr property name (optional). If it is not defined, fieldname is used to specify the jcr property name + * id : specifies if the field is an id. Id is optional. If the class contains an id field, some process can run faster + * path : specified if the fiels is the object path + * jcrType: specifies the JCR property type (supported jcr property types: STRING, DATE, LONG, DOUBLE, BOOLEAN), optional + * jcrAutoCreated: specifies if this JCR property will be autocreated (true/false / default is false), optional + * jcrMandatory: specifies if this JCR property is mandatory (true/false / default is false), optional + * jcrOnParentVersion: specifies how this JCR property acts on inherited versioned node properties (default is COPY), optional + * jcrProtected: specifies if this JCR node property is protected (true/false / default is false), optional + * jcrMultiple: specifies if this JCR node property is a multivalued property (true/false / default is false), optional +--> + +<!ELEMENT field-descriptor EMPTY> +<!ATTLIST field-descriptor + fieldName CDATA #REQUIRED + fieldType CDATA #IMPLIED + jcrName CDATA #IMPLIED + id (true | false) "false" + path (true | false) "false" + jcrType (String | Date | Long | Double | Boolean | Binary) #IMPLIED + jcrAutoCreated (true | false) "false" + jcrMandatory (true | false) "false" + jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY" + jcrProtected (true | false) "false" + jcrMultiple (true | false) "false" +> + +<!-- + Bean descriptor - A bean descriptor maps one "complex" object attribute into a JCR node. + * fieldName : the field/attribute name + * jcrName : the jcr node name (optional). If it is not defined, fieldname is used to specify the jcr node name + * proxy : Use lazy loading or not. if true, this attributes is not loaded when the main object is retrieved. it will be loaded when the get method is called. + * autoRetrieve : If false, the bean associated to this descriptor is not retrieved when the main ojbect is retrieved + * autoUpdate : If false, the bean associated to this descriptor is not updated when the main ojbect is updated + * autoInsert : If false, the bean associated to this descriptor is not inserted when the main ojbect is inserted + * inline: persist/retrieve bean properties from the current node (if true). + * converter: fully qualified name of the converter class to be used (default is ObjectConverterImpl) + * jcrNodeType: defines the child node type, optional + * jcrAutoCreated (boolean) default is "false" + * jcrMandatory (boolean) default is "false" + * jcrOnParentVersion default is "COPY" + * jcrProtected (boolean) default is "false" + * jcrSameNameSiblings (boolean) default is "false" +--> +<!ELEMENT bean-descriptor EMPTY> +<!ATTLIST bean-descriptor + fieldName CDATA #REQUIRED + jcrName CDATA #IMPLIED + proxy (true | false) "false" + autoRetrieve (true|false) "true" + autoUpdate (true|false) "true" + autoInsert (true|false) "true" + inline (true | false) "false" + converter CDATA #IMPLIED + jcrNodeType CDATA #IMPLIED + jcrAutoCreated (true | false) "false" + jcrMandatory (true | false) "false" + jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY" + jcrProtected (true | false) "false" + jcrSameNameSiblings (true | false) "false" +> + +<!-- + Collection descriptor - A collection descriptor maps one object attribute based on a collection (or a map) into a series of JCR nodes. + * fieldName : the field/attribute name (matching to the collection attribute) + * jcrName : the jcr property name (optional). If it is not defined, fieldname is used to specify the jcr node name + * proxy : Use lazy loading or not. if true, this attributes is not loaded when the main object is retrieve. it will be loaded when the get method is called. + * autoRetrieve : If false, the collection associated to this descriptor is not retrieved when the main ojbect is retrieved + * autoUpdate : If false, the collection associated to this descriptor is not updated when the main ojbect is updated + * autoInsert : If false, the collection associated to this descriptor is not inserted when the main ojbect is inserted + * elementClassName : contains a fully qualified class name. This class is the Object type of the persistent collection elements. + * collectionClassName : contains a fully qualified class name. This class must be the Java type of the Collection attribute. + This attribute must only specified if the attribute type is not a java.util.Collection (or subclass). + The declared class must implement ManageableCollection to let the persistence engine handles this type of collection. + * collectionConverter : The class name converter. This is the collection mapping strategy to used. + If this attribute is not specify, the default collection mapping strategy is used (DefaultCollectionConverterImpl) + * jcrNodeType: defines the child node type, optional + * jcrAutoCreated (boolean) default is "false" + * jcrMandatory (boolean) default is "false" + * jcrOnParentVersion default is "COPY" + * jcrProtected (boolean) default is "false" + * jcrSameNameSiblings (boolean) default is "false" +--> + +<!ELEMENT collection-descriptor EMPTY> +<!ATTLIST collection-descriptor + fieldName CDATA #REQUIRED + jcrName CDATA #IMPLIED + proxy (true | false) "false" + autoRetrieve (true|false) "true" + autoUpdate (true|false) "true" + autoInsert (true|false) "true" + elementClassName CDATA #REQUIRED + collectionClassName CDATA #IMPLIED + collectionConverter CDATA #IMPLIED + jcrNodeType CDATA #IMPLIED + jcrAutoCreated (true | false) "false" + jcrMandatory (true | false) "false" + jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY" + jcrProtected (true | false) "false" + jcrSameNameSiblings (true | false) "false" +> Added: incubator/graffito/trunk/jcr/spring/src/test-config/jaas.config URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test-config/jaas.config?rev=414365&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test-config/jaas.config (added) +++ incubator/graffito/trunk/jcr/spring/src/test-config/jaas.config Wed Jun 14 12:42:43 2006 @@ -0,0 +1,3 @@ +Jackrabbit { +org.apache.jackrabbit.core.security.SimpleLoginModule required debug=false; +}; \ No newline at end of file Added: incubator/graffito/trunk/jcr/spring/src/test-config/jcrmapping.xml URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test-config/jcrmapping.xml?rev=414365&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test-config/jcrmapping.xml (added) +++ incubator/graffito/trunk/jcr/spring/src/test-config/jcrmapping.xml Wed Jun 14 12:42:43 2006 @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE graffito-jcr PUBLIC "-//The Apache Software Foundation//DTD Repository//EN" "./src/test-config/graffito-jcr-mapping.dtd"> +<graffito-jcr> + + + <class-descriptor className="org.apache.portals.graffito.jcr.spring.test.model.News" discriminator="true"> + <field-descriptor fieldName="path" path="true" /> + <field-descriptor fieldName="creationDate" jcrName="graffito:creationDate" /> + <field-descriptor fieldName="content" jcrName="graffito:content" /> + </class-descriptor> + + <class-descriptor className="org.apache.portals.graffito.jcr.spring.test.model.Article" discriminator="true"> + <field-descriptor fieldName="path" path="true" /> + <field-descriptor fieldName="title" jcrName="graffito:title" /> + <field-descriptor fieldName="description" jcrName="graffito:description" /> + <field-descriptor fieldName="author" jcrName="graffito:author" /> + <field-descriptor fieldName="creationDate" jcrName="graffito:creationDate" /> + <field-descriptor fieldName="content" jcrName="graffito:content" /> + </class-descriptor> + +</graffito-jcr> + \ No newline at end of file Propchange: incubator/graffito/trunk/jcr/spring/src/test-config/jcrmapping.xml ------------------------------------------------------------------------------ svn:executable = * Added: incubator/graffito/trunk/jcr/spring/src/test-config/repository-bdb.xml URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test-config/repository-bdb.xml?rev=414365&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test-config/repository-bdb.xml (added) +++ incubator/graffito/trunk/jcr/spring/src/test-config/repository-bdb.xml Wed Jun 14 12:42:43 2006 @@ -0,0 +1,207 @@ +<?xml version="1.0"?> +<!DOCTYPE Repository [ + <!-- + the Repository element configures a repository instance; + individual workspaces of the repository are configured through + separate configuration files called workspace.xml which are + located in a subfolder of the workspaces root directory + (see Workspaces element). + + it consists of + + a FileSystem element (the virtual file system + used by the repository to persist global state such as + registered namespaces, custom node types, etc.. + + a Security element that specifies the name of the app-entry + in the JAAS config and the access manager + + a Workspaces element that specifies to the location of + workspaces root directory and the name of default workspace + + a Workspace element that is used as a workspace configuration + template; it is used to create the initial workspace if there's + no workspace yet and for creating additional workspaces through + the api + + a SearchIndex element that is used for configuring per workspace + Indexing-related settings + + a Versioning element that is used for configuring + versioning-related settings + --> + <!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace,Versioning)> + + <!-- + a virtual file system + --> + <!ELEMENT FileSystem (param*)> + <!ATTLIST FileSystem + class CDATA #REQUIRED> + + <!-- + the Security element specifies the name (appName attribute) + of the JAAS configuration app-entry for this repository. + + it also specifies the access manager to be used (AccessManager element). + --> + <!ELEMENT Security (AccessManager, LoginModule?)> + <!ATTLIST Security + appName CDATA #REQUIRED> + + <!-- + the AccessManager element configures the access manager to be used by + this repository instance; the class attribute specifies the FQN of the + class implementing the AccessManager interface + --> + <!ELEMENT AccessManager (param*)> + <!ATTLIST AccessManager + class CDATA #REQUIRED> + + <!-- + generic parameter (name/value pair) + --> + <!ELEMENT param EMPTY> + <!ATTLIST param + name CDATA #REQUIRED + value CDATA #REQUIRED> + + <!-- + the LoginModule element optionally specifies a JAAS login module to + authenticate users. This feature allows the use of Jackrabbit in a + non-JAAS environment. + --> + <!ELEMENT LoginModule (param*)> + <!ATTLIST LoginModule + class CDATA #REQUIRED> + + <!-- + the Workspaces element specifies the workspaces root directory + (rootPath attribute) and the name of the default workspace + (defaultWorkspace attribute). + + individual workspaces are configured through individual workspace.xml + files located in a subfolder each of the workspaces root directory. + --> + <!ELEMENT Workspaces EMPTY> + <!ATTLIST Workspaces + rootPath CDATA #REQUIRED + defaultWorkspace CDATA #REQUIRED> + + <!-- + the Workspace element serves as a workspace configuration template; + it is used to create the initial workspace if there's no workspace yet + and for creating additional workspaces through the api + --> + <!ELEMENT Workspace (FileSystem,PersistenceManager,SearchIndex?)> + <!ATTLIST Workspace + name CDATA #REQUIRED> + + <!-- + the PersistenceManager element configures the persistence manager + to be used for the workspace; the class attribute specifies the + FQN of the class implementing the PersistenceManager interface + --> + <!ELEMENT PersistenceManager (param*)> + <!ATTLIST PersistenceManager + class CDATA #REQUIRED> + + <!-- + the SearchIndex element specifies the locaction of the search index + (used by the QueryHandler); the class attribute specifies the + FQN of the class implementing the QueryHandler interface. + --> + <!ELEMENT SearchIndex (param*,FileSystem?)> + <!ATTLIST SearchIndex + class CDATA #REQUIRED> + + <!-- + the Versioning element configures the persistence manager + to be used for persisting version state + --> + <!ELEMENT Versioning (FileSystem, PersistenceManager)> + <!ATTLIST Versioning + rootPath CDATA #REQUIRED + > +]> +<!-- Example Repository Configuration File --> +<Repository> + <!-- + virtual file system where the repository stores global state + (e.g. registered namespaces, custom node types, etc.) + --> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${rep.home}/repository"/> + </FileSystem> + + <!-- + security configuration + --> + <Security appName="Jackrabbit"> + <!-- + access manager: + class: FQN of class implementing the AccessManager interface + --> + <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"> + <!-- <param name="config" value="${rep.home}/access.xml"/> --> + </AccessManager> + + <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule"> + <!-- anonymous user name ('anonymous' is the default value) --> + <param name="anonymousId" value="anonymous"/> + </LoginModule> + </Security> + + <!-- + location of workspaces root directory and name of default workspace + --> + <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/> + <!-- + workspace configuration template: + used to create the initial workspace if there's no workspace yet + --> + <Workspace name="${wsp.name}"> + <!-- + virtual file system of the workspace: + class: FQN of class implementing the FileSystem interface + --> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${wsp.home}"/> + </FileSystem> + <!-- + persistence manager of the workspace: + class: FQN of class implementing the PersistenceManager interface + --> + <PersistenceManager class="org.apache.jackrabbit.core.state.bdb.BerkeleyDBPersistenceManager" /> + + <!-- + Search index and the file system it uses. + class: FQN of class implementing the QueryHandler interface + --> + <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> + <param name="path" value="${wsp.home}/index"/> + </SearchIndex> + </Workspace> + + <!-- + Configures the versioning + --> + <Versioning rootPath="${rep.home}/version"> + <!-- + Configures the filesystem to use for versioning for the respective + persistence manager + --> + <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${rep.home}/version" /> + </FileSystem> + + <!-- + Configures the persistence manager to be used for persisting version state. + Please note that the current versioning implementation is based on + a 'normal' persistence manager, but this could change in future + implementations. + --> + + <PersistenceManager class="org.apache.jackrabbit.core.state.bdb.BerkeleyDBPersistenceManager" /> + </Versioning> +</Repository> Added: incubator/graffito/trunk/jcr/spring/src/test-config/repository-derby.xml URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/spring/src/test-config/repository-derby.xml?rev=414365&view=auto ============================================================================== --- incubator/graffito/trunk/jcr/spring/src/test-config/repository-derby.xml (added) +++ incubator/graffito/trunk/jcr/spring/src/test-config/repository-derby.xml Wed Jun 14 12:42:43 2006 @@ -0,0 +1,212 @@ +<?xml version="1.0"?> +<!DOCTYPE Repository [ + <!-- + the Repository element configures a repository instance; + individual workspaces of the repository are configured through + separate configuration files called workspace.xml which are + located in a subfolder of the workspaces root directory + (see Workspaces element). + + it consists of + + a FileSystem element (the virtual file system + used by the repository to persist global state such as + registered namespaces, custom node types, etc.. + + a Security element that specifies the name of the app-entry + in the JAAS config and the access manager + + a Workspaces element that specifies to the location of + workspaces root directory and the name of default workspace + + a Workspace element that is used as a workspace configuration + template; it is used to create the initial workspace if there's + no workspace yet and for creating additional workspaces through + the api + + a SearchIndex element that is used for configuring per workspace + Indexing-related settings + + a Versioning element that is used for configuring + versioning-related settings + --> + <!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace,Versioning)> + + <!-- + a virtual file system + --> + <!ELEMENT FileSystem (param*)> + <!ATTLIST FileSystem + class CDATA #REQUIRED> + + <!-- + the Security element specifies the name (appName attribute) + of the JAAS configuration app-entry for this repository. + + it also specifies the access manager to be used (AccessManager element). + --> + <!ELEMENT Security (AccessManager, LoginModule?)> + <!ATTLIST Security + appName CDATA #REQUIRED> + + <!-- + the AccessManager element configures the access manager to be used by + this repository instance; the class attribute specifies the FQN of the + class implementing the AccessManager interface + --> + <!ELEMENT AccessManager (param*)> + <!ATTLIST AccessManager + class CDATA #REQUIRED> + + <!-- + generic parameter (name/value pair) + --> + <!ELEMENT param EMPTY> + <!ATTLIST param + name CDATA #REQUIRED + value CDATA #REQUIRED> + + <!-- + the LoginModule element optionally specifies a JAAS login module to + authenticate users. This feature allows the use of Jackrabbit in a + non-JAAS environment. + --> + <!ELEMENT LoginModule (param*)> + <!ATTLIST LoginModule + class CDATA #REQUIRED> + + <!-- + the Workspaces element specifies the workspaces root directory + (rootPath attribute) and the name of the default workspace + (defaultWorkspace attribute). + + individual workspaces are configured through individual workspace.xml + files located in a subfolder each of the workspaces root directory. + --> + <!ELEMENT Workspaces EMPTY> + <!ATTLIST Workspaces + rootPath CDATA #REQUIRED + defaultWorkspace CDATA #REQUIRED> + + <!-- + the Workspace element serves as a workspace configuration template; + it is used to create the initial workspace if there's no workspace yet + and for creating additional workspaces through the api + --> + <!ELEMENT Workspace (FileSystem,PersistenceManager,SearchIndex?)> + <!ATTLIST Workspace + name CDATA #REQUIRED> + + <!-- + the PersistenceManager element configures the persistence manager + to be used for the workspace; the class attribute specifies the + FQN of the class implementing the PersistenceManager interface + --> + <!ELEMENT PersistenceManager (param*)> + <!ATTLIST PersistenceManager + class CDATA #REQUIRED> + + <!-- + the SearchIndex element specifies the locaction of the search index + (used by the QueryHandler); the class attribute specifies the + FQN of the class implementing the QueryHandler interface. + --> + <!ELEMENT SearchIndex (param*,FileSystem?)> + <!ATTLIST SearchIndex + class CDATA #REQUIRED> + + <!-- + the Versioning element configures the persistence manager + to be used for persisting version state + --> + <!ELEMENT Versioning (FileSystem, PersistenceManager)> +
{'source': 'Apache Software Foundation Public Mail Archives'}