incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r354166 [1/3] - in /incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr: exception/ mapper/ mapper/impl/ mapper/model/ persistence/ persistence/atomictypeconverter/ persistence/atomictypeconverter/impl/ persist...
Date Mon, 05 Dec 2005 20:36:34 GMT
Author: clombart
Date: Mon Dec  5 12:35:57 2005
New Revision: 354166

URL: http://svn.apache.org/viewcvs?rev=354166&view=rev
Log:
Move jcr-mapping project

Added:
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CannotUnlockException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockedException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockingException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/VersionException.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java
    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/mapper/model/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/CustomNodeTypeCreator.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/AtomicTypeConverter.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/AbstractAtomicTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/CollectionConverter.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollection.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollectionUtil.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/CustomNodeTypeCreatorImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/ObjectIterator.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/persistence/objectconverter/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/ObjectConverter.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/Filter.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/Query.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/QueryManager.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/FilterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/QueryImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/QueryManagerImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/security/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/security/SimpleAccessManager.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/security/SimpleLoginModule.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/transaction/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/transaction/jackrabbit/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/transaction/jackrabbit/UserTransactionImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/version/
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/version/Version.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/version/VersionIterator.java

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CannotUnlockException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CannotUnlockException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CannotUnlockException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CannotUnlockException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+/**
+ * If user cannot unlock path, for example if he/she have not correct lockTokens
+ * 
+ * @author Martin Koci
+ * 
+ */
+public class CannotUnlockException extends LockingException
+{
+
+	private final String lockOwner;
+
+	private final String path;
+
+	/**
+	 * 
+	 * @return The JCR Lock Owner
+	 */
+	public String getLockOwner()
+	{
+		return lockOwner;
+	}
+
+	/**
+	 * 
+	 * @return the JCR path
+	 */
+	public String getPath()
+	{
+		return path;
+	}
+
+	public CannotUnlockException(String lockOwner, String path)
+	{
+		super();
+		this.lockOwner = lockOwner;
+		this.path = path;
+	}
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+/** This exception is thrown during repository setup while creating the
+ * custom graffito node types.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ * @version $Id: Exp $
+ */
+public class CustomNodeTypeCreationException extends JcrMappingException {
+    
+    /**
+     * Default Constructor without information.
+     */
+    public CustomNodeTypeCreationException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public CustomNodeTypeCreationException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public CustomNodeTypeCreationException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public CustomNodeTypeCreationException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package org.apache.portals.graffito.jcr.exception;
+
+/**
+ * Occurs when the jcr mapping converters try to assign or read an incorrect atomic field type.
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ *
+ */
+public class IncorrectAtomicTypeException extends JcrMappingException
+{
+
+	public IncorrectAtomicTypeException()
+	{
+		super();
+		
+	}
+
+	public IncorrectAtomicTypeException(String message, Throwable nested)
+	{
+		super(message, nested);
+		
+	}
+
+	public IncorrectAtomicTypeException(String message)
+	{
+		super(message);
+		
+	}
+
+	public IncorrectAtomicTypeException(Throwable nested)
+	{
+		super(nested);
+		
+	}
+
+
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+
+/**
+ * Occurs when it is not possible to initialise the Mapper 
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ */
+
+public class InitMapperException extends JcrMappingException
+{
+
+    /**
+     * Default Constructor without information.
+     */
+    public InitMapperException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public InitMapperException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public InitMapperException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public InitMapperException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+
+/**
+ * 
+ * Base class of all runtime exceptions used in the JCR mapping.
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ */
+
+public class JcrMappingException extends RuntimeException
+{
+
+    /**
+     * Default Constructor without information.
+     */
+    public JcrMappingException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public JcrMappingException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public JcrMappingException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public JcrMappingException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockedException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockedException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockedException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockedException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+/**
+ * Throwed if a path is locked and a operation cannot be performed 
+ *   
+ * @author markoc
+ */
+
+public class LockedException extends LockingException {
+
+    private final String lockOwner;
+
+    private final String lockedNodePath;
+
+    public LockedException(String lockOwner, String lockedNodePath) {
+        super();
+        this.lockOwner = lockOwner;
+        this.lockedNodePath = lockedNodePath;
+    }
+
+    /**
+     * 
+     * @return The JCR Lock Owner
+     */
+    public String getLockOwner() {
+        return lockOwner;
+    }
+
+    /**
+     * 
+     * @return The JCR locked node path 
+     */
+    public String getLockedNodePath() {
+        return lockedNodePath;
+    }
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockingException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockingException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockingException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/LockingException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+/**
+ * Base exception for all exceptions related to JCR Locking feature. 
+ * 
+ * @author markoc
+ */
+public class LockingException extends PersistenceException 
+{
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+
+/**
+ * Occurs when it is not possible to persist an object
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ */
+
+public class PersistenceException extends JcrMappingException
+{
+
+    /**
+     * Default Constructor without information.
+     */
+    public PersistenceException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public PersistenceException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public PersistenceException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public PersistenceException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+
+/**
+ * Occurs when it is not possible to manage the JCR repository (register, login, ...)
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ */
+
+public class RepositoryException extends JcrMappingException
+{
+
+    /**
+     * Default Constructor without information.
+     */
+    public RepositoryException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public RepositoryException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public RepositoryException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public RepositoryException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/VersionException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/VersionException.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/VersionException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/VersionException.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2005 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.exception;
+
+
+/**
+ * Occurs when it is not possible to read information on version or manage versions
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ */
+
+public class VersionException extends JcrMappingException
+{
+
+    /**
+     * Default Constructor without information.
+     */
+    public VersionException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public VersionException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public VersionException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public VersionException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2005 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.mapper;
+
+import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor;
+
+/**
+ * This component read the mapping file and gives an access to the ClassDescriptors (the mapping object model)
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * 
+ */
+public interface Mapper
+{
+    /**
+     * Get the mapping defition to be used for a specific java bean
+     * @param clazz The java bean class
+     * @return The mapping class found for the desired java bean class 
+     */
+    public abstract ClassDescriptor getClassDescriptor(Class clazz);
+}
\ No newline at end of file

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2000-20045 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.mapper.impl;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+
+import org.apache.commons.digester.Digester;
+import org.apache.portals.graffito.jcr.exception.InitMapperException;
+import org.apache.portals.graffito.jcr.mapper.model.BeanDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.CollectionDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.FieldDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.MappingDescriptor;
+
+/**
+ * Helper class that reads the xml mapping file and load all class descriptors into memory (object graph)
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * 
+ */
+public class DigesterDescriptorReader
+{
+	/**
+	 * Load all class descriptors found in the xml mapping file.
+	 * 
+	 * @param stream the xml mapping file reference
+	 * @return a {@link MappingDescriptor}
+	 * 
+	 */
+	public static MappingDescriptor loadClassDescriptors(InputStream stream)
+	{
+		try
+		{
+			Digester digester = new Digester();
+			digester.setValidating(true);
+
+			digester.addObjectCreate("graffito-jcr", MappingDescriptor.class);
+
+			// --------------------------------------------------------------------------------
+			// Rules used for the class-descriptor element
+			// --------------------------------------------------------------------------------
+
+			digester.addObjectCreate("graffito-jcr/class-descriptor", ClassDescriptor.class);
+			digester.addSetProperties("graffito-jcr/class-descriptor", "className", "className");
+			digester.addSetProperties("graffito-jcr/class-descriptor", "jcrNodeType", "jcrNodeType");
+            digester.addSetProperties("graffito-jcr/class-descriptor", "jcrSuperTypes", "jcrSuperTypes");
+
+			digester.addSetNext("graffito-jcr/class-descriptor", "addClassDescriptor");
+
+			// --------------------------------------------------------------------------------
+			// Rules used for the field-descriptor element
+			// --------------------------------------------------------------------------------
+
+			digester.addObjectCreate("graffito-jcr/class-descriptor/field-descriptor", FieldDescriptor.class);
+			digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "fieldName", "fieldName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrName", "jcrName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "id", "id");
+			digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "path", "path");
+            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrType", "jcrType");
+            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrAutoCreated", "jcrAutoCreated");
+            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrMandatory", "jcrMandatory");
+            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrOnParentVersion", "jcrOnParentVersion");
+            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrProtected", "jcrProtected");
+            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrMultiple", "jcrMultiple");
+			digester.addSetNext("graffito-jcr/class-descriptor/field-descriptor", "addFieldDescriptor");
+
+			// --------------------------------------------------------------------------------
+			// Rules used for the bean-descriptor element
+			// --------------------------------------------------------------------------------
+
+			digester.addObjectCreate("graffito-jcr/class-descriptor/bean-descriptor", BeanDescriptor.class);
+			digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "fieldName", "fieldName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrName", "jcrName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "proxy", "proxy");
+            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrNodeType", "jcrNodeType");
+            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrAutoCreated", "jcrAutoCreated");
+            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrMandatory", "jcrMandatory");
+            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrOnParentVersion", "jcrOnParentVersion");
+            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrProtected", "jcrProtected");
+            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrSameNameSiblings", "jcrSameNameSiblings");
+			digester.addSetNext("graffito-jcr/class-descriptor/bean-descriptor", "addBeanDescriptor");
+
+			// --------------------------------------------------------------------------------
+			// Rules used for the collection-descriptor element
+			// --------------------------------------------------------------------------------
+
+			digester.addObjectCreate("graffito-jcr/class-descriptor/collection-descriptor", CollectionDescriptor.class);
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "fieldName", "fieldName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrName", "jcrName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "proxy", "proxy");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "elementClassName", "elementClassName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "collectionConverter", "collectionConverterClassName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "collectionClassName", "collectionClassName");
+            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrNodeType", "jcrNodeType");
+            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrAutoCreated", "jcrAutoCreated");
+            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrMandatory", "jcrMandatory");
+            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrOnParentVersion", "jcrOnParentVersion");
+            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrProtected", "jcrProtected");
+            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrSameNameSiblings", "jcrSameNameSiblings");            
+			digester.addSetNext("graffito-jcr/class-descriptor/collection-descriptor", "addCollectionDescriptor");
+
+			MappingDescriptor mappingDescriptor = (MappingDescriptor) digester.parse(stream);
+			return mappingDescriptor;
+		}
+		catch (Exception e)
+		{
+			throw new InitMapperException("Impossible to read the xml mapping file", e);
+		}
+	}
+
+	/**
+	 * Load all class descriptors found in the xml mapping file.
+	 * 
+	 * @param xmlFile the xml mapping file reference
+	 * @return a {@link MappingDescriptor}
+	 * 
+	 */	
+	public static MappingDescriptor loadClassDescriptors(String xmlFile)
+	{
+		try
+		{
+			return loadClassDescriptors(new FileInputStream(xmlFile));
+		}
+		catch (FileNotFoundException e)
+		{
+			throw new InitMapperException(e);
+		}
+	}
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2000-2005 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.mapper.impl;
+
+import java.io.InputStream;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.portals.graffito.jcr.mapper.Mapper;
+import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.MappingDescriptor;
+
+/**
+ *
+ * Digester implementation for {@link org.apache.portals.graffito.jcr.mapper.Mapper}
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ */
+public class DigesterMapperImpl implements Mapper
+{    
+    private MappingDescriptor mappingDescriptor;
+    private Log log = LogFactory.getLog(DigesterMapperImpl.class); 
+    
+    /**
+     * Constructor
+     *  
+     * @param xmlFile The xml mapping file to read
+     *
+     */
+    public DigesterMapperImpl(String xmlFile)
+    {
+        log.info("Read the xml mapping file : " +  xmlFile);
+        mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(xmlFile);
+    }
+    
+    /**
+     * Constructor 
+     * 
+     * @param files a set of xml mapping files to read
+     *
+     */
+    public DigesterMapperImpl(String[] files)
+    {
+    	log.info("Read the xml mapping file : " +  files[0]);
+        mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(files[0]);
+        for (int i=1; i<files.length;i++)
+        {
+        	log.info("Read the xml mapping file : " +  files[i]);
+            MappingDescriptor anotherMappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(files[i]);
+            mappingDescriptor.getClassDescriptors().putAll(anotherMappingDescriptor.getClassDescriptors());
+        }
+    }
+    
+    /**
+     * Constructor
+     *  
+     * @param stream The xml mapping file to read
+     */
+    public DigesterMapperImpl(InputStream stream)
+    {
+        log.info("Read the input stream : " +  stream.toString());
+        mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(stream);
+    }
+
+    /**
+     * Constructor 
+     * 
+     * @param streams a set of mapping files to read
+     *
+     */
+    public DigesterMapperImpl(InputStream[] streams)
+    {
+    	log.info("Read the input stream : " +  streams[0].toString());
+        mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(streams[0]);
+        for (int i=1; i<streams.length;i++)
+        {
+        	log.info("Read the input stream : " +  streams[i].toString());
+            MappingDescriptor anotherMappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(streams[i]);
+            mappingDescriptor.getClassDescriptors().putAll(anotherMappingDescriptor.getClassDescriptors());
+        }
+    }
+
+    /**
+     * 
+     * @see org.apache.portals.graffito.jcr.mapper.Mapper#getClassDescriptor(java.lang.Class)
+     */
+    public ClassDescriptor getClassDescriptor(Class clazz) 
+    {        
+        return mappingDescriptor.getClassDescriptor(clazz.getName());
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2000-2005 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.mapper.model;
+
+/**
+ * BeanDescriptor is used by the mapper to read general information on a bean field
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * 
+ */
+public class BeanDescriptor
+{
+
+     private String fieldName;
+     private String jcrName;
+     private boolean proxy; 
+     private String jcrNodeType;
+     private boolean jcrAutoCreated;
+     private boolean jcrMandatory;
+     private String jcrOnParentVersion;
+     private boolean jcrProtected;
+     private boolean jcrSameNameSiblings;
+
+    /**
+     * @return Returns the fieldName.
+     */
+    public String getFieldName()
+    {
+        return fieldName;
+    }
+    /**
+     * @param fieldName The fieldName to set.
+     */
+    public void setFieldName(String fieldName)
+    {
+        this.fieldName = fieldName;
+    }
+    /**
+     * @return Returns the jcrName.
+     */
+    public String getJcrName()
+    {
+        return jcrName;
+    }
+    /**
+     * @param jcrName The jcrName to set.
+     */
+    public void setJcrName(String jcrName)
+    {
+        this.jcrName = jcrName;
+    }
+    
+    
+    /**
+     * @return Returns the proxy.
+     */
+    public boolean isProxy()
+    {
+        return proxy;
+    }
+    /**
+     * @param proxy The proxy to set.
+     */
+    public void setProxy(boolean proxy)
+    {
+        this.proxy = proxy;
+    }
+
+    /** Getter for property jcrNodeType.
+     * 
+     * @return jcrNodeType
+     */
+    public String getJcrNodeType()
+    {
+        return jcrNodeType;
+    }
+
+    /** Setter for property jcrNodeType.
+     * 
+     * @param value jcrNodeType
+     */
+    public void setJcrNodeType(String value)
+    {
+        this.jcrNodeType = value;
+    }
+
+    /** Getter for property jcrAutoCreated.
+     * 
+     * @return jcrAutoCreated
+     */
+    public boolean isJcrAutoCreated()
+    {
+        return jcrAutoCreated;
+    }
+
+    /** Setter for property jcrAutoCreated.
+     * 
+     * @param value jcrAutoCreated
+     */
+    public void setJcrAutoCreated(boolean value)
+    {
+        this.jcrAutoCreated = value;
+    }
+
+    /** Getter for property jcrMandatory.
+     * 
+     * @return jcrMandatory
+     */
+    public boolean isJcrMandatory()
+    {
+        return jcrMandatory;
+    }
+
+    /** Setter for property jcrMandatory.
+     * 
+     * @param value jcrMandatory
+     */
+    public void setJcrMandatory(boolean value)
+    {
+        this.jcrMandatory = value;
+    }
+
+    /** Getter for property jcrOnParentVersion.
+     * 
+     * @return jcrOnParentVersion
+     */
+    public String getJcrOnParentVersion()
+    {
+        return jcrOnParentVersion;
+    }
+
+    /** Setter for property jcrOnParentVersion.
+     * 
+     * @param value jcrOnParentVersion
+     */
+    public void setJcrOnParentVersion(String value)
+    {
+        this.jcrOnParentVersion = value;
+    }
+
+    /** Getter for property jcrProtected.
+     * 
+     * @return jcrProtected
+     */
+    public boolean isJcrProtected()
+    {
+        return jcrProtected;
+    }
+
+    /** Setter for property jcrProtected.
+     * 
+     * @param value jcrProtected
+     */
+    public void setJcrProtected(boolean value)
+    {
+        this.jcrProtected = value;
+    }
+
+    /** Getter for property jcrSameNameSiblings.
+     * 
+     * @return jcrSameNameSiblings
+     */
+    public boolean isJcrSameNameSiblings()
+    {
+        return jcrSameNameSiblings;
+    }
+
+    /** Setter for property jcrSameNameSiblings.
+     * 
+     * @param value jcrSameNameSiblings
+     */
+    public void setJcrSameNameSiblings(boolean value)
+    {
+        this.jcrSameNameSiblings = value;
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2000-2005 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.mapper.model;
+
+import java.util.Collection;
+import java.util.HashMap;
+
+/**
+ * 
+ * ClassDescriptor is used by the mapper to read general information on a class
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * 
+ */
+public class ClassDescriptor
+{
+
+     private String className;
+     private String jcrNodeType;
+     private String jcrSuperTypes;
+     private FieldDescriptor idFieldDescriptor;
+     private FieldDescriptor pathFieldDescriptor;
+     
+     private HashMap fieldDescriptors = new HashMap();
+     private HashMap beanDescriptors = new HashMap();
+     private HashMap collectionDescriptors = new HashMap();
+     private HashMap fieldNames = new HashMap();
+    
+    
+    /**
+     * @return Returns the className.
+     */
+    public String getClassName()
+    {
+        return className;
+    }
+    /**
+     * @param className The className to set.
+     */
+    public void setClassName(String className)
+    {
+        this.className = className;
+    }
+    
+    
+    /**
+     * @return Returns the jcrNodeType.
+     */
+    public String getJcrNodeType()
+    {
+        return jcrNodeType;
+    }
+    /**
+     * @param jcrNodeType The jcrNodeType to set.
+     */
+    public void setJcrNodeType(String jcrNodeType)
+    {
+        this.jcrNodeType = jcrNodeType;
+    }
+    
+    /**
+     * Add a new FielDescriptor
+     * @param fieldDescriptor the new field descriptor to add
+     */
+    public void addFieldDescriptor(FieldDescriptor fieldDescriptor )
+    {
+        fieldDescriptor.setClassDescriptor(this);
+        if (fieldDescriptor.isId())
+        {
+           this.idFieldDescriptor = fieldDescriptor;
+        }
+        
+        if (fieldDescriptor.isPath())
+        {
+        	this.pathFieldDescriptor = fieldDescriptor;
+        }
+        
+        fieldDescriptors.put(fieldDescriptor.getFieldName(), fieldDescriptor);
+        fieldNames.put(fieldDescriptor.getFieldName(), fieldDescriptor.getJcrName());
+    }
+    
+    /**
+     * Get the FieldDescriptor to used for a specific java bean attribute
+     * @param fieldName The java bean attribute name
+     * 
+     * @return the {@link FieldDescriptor} found or null
+     */
+    public FieldDescriptor getFieldDescriptor(String fieldName)
+    {
+        return (FieldDescriptor) fieldDescriptors.get(fieldName);
+    }
+    
+    /**
+     * 
+     * @return all {@link FieldDescriptor} defined in this ClassDescriptor
+     */
+    public Collection getFieldDescriptors()
+    {
+        return fieldDescriptors.values();   
+    }
+    
+    /**
+     * Add a new BeanDescriptor
+     * @param beanDescriptor the new bean descriptor to add
+     */
+                  
+    public void addBeanDescriptor(BeanDescriptor beanDescriptor )
+    {
+        beanDescriptors.put(beanDescriptor.getFieldName(), beanDescriptor);
+        fieldNames.put(beanDescriptor.getFieldName(), beanDescriptor.getJcrName());
+    }
+
+    /**
+     * Get the BeanDescriptor to used for a specific java bean attribute
+     * @param fieldName The java bean attribute name
+     * 
+     * @return the {@link BeanDescriptor} found or null
+     */
+    public BeanDescriptor getBeanDescriptor(String fieldName)
+    {
+        return (BeanDescriptor) beanDescriptors.get(fieldName);
+    }
+    
+    
+    /**     
+     * @return all {@link BeanDescriptor} defined in this ClassDescriptor
+     */
+    public Collection getBeanDescriptors()
+    {
+        return beanDescriptors.values();   
+    }
+
+    
+    /**
+     * Add a new CollectionDescriptor
+     * @param collectionDescriptor the new collection descriptor to add
+     */
+                  
+    public void addCollectionDescriptor(CollectionDescriptor collectionDescriptor )
+    {
+        collectionDescriptor.setClassDescriptor(this);
+        collectionDescriptors.put(collectionDescriptor.getFieldName(), collectionDescriptor);
+        fieldNames.put(collectionDescriptor.getFieldName(), collectionDescriptor.getJcrName());
+    }
+
+    /**
+     * Get the CollectionDescriptor to used for a specific java bean attribute
+     * @param fieldName The java bean attribute name
+     * 
+     * @return the {@link CollectionDescriptor} found or null
+     */
+    public CollectionDescriptor getCollectionDescriptor(String fieldName)
+    {
+        return (CollectionDescriptor) collectionDescriptors.get(fieldName);
+    }
+        
+    /**
+     * @return all {@link BeanDescriptor} defined in this ClassDescriptor
+     */
+    public Collection getCollectionDescriptors()
+    {
+        return collectionDescriptors.values();   
+    }
+    
+    /**
+     * @return the fieldDescriptor ID  
+     */
+    public FieldDescriptor getIdFieldDescriptor()
+    {
+        return idFieldDescriptor;
+    }
+    
+    /**
+     * @return the fieldDescriptor path  
+     */
+    public FieldDescriptor getPathFieldDescriptor()
+    {
+        return pathFieldDescriptor;
+    }
+    
+    /**
+     * Check if this class has an ID 
+     * @return true if the class has an ID
+     */
+    public boolean hasIdField()
+    {
+        return this.idFieldDescriptor != null;
+    }
+    
+    /**
+     * Get the JCR name used for one of the object attributes
+     * @param fieldName the object attribute name (can be an atomic field, bean field or a collection field)
+     * @return the JCR name found 
+     */
+    public String getJcrName(String fieldName)
+    {
+    	return (String) this.fieldNames.get(fieldName);
+    }
+
+    /** Get the JCR node super types.
+     * 
+     * @return jcrSuperTypes
+     */
+    public String getJcrSuperTypes()
+    {
+        return jcrSuperTypes;
+    }
+
+    /** Setter for JCR super types.
+     * 
+     * @param superTypes Comma separated list of JCR node super types
+     */
+    public void setJcrSuperTypes(String superTypes)
+    {
+        this.jcrSuperTypes = superTypes;
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2000-2005 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.mapper.model;
+
+/**
+ * 
+ * CollectionDescriptor is used by the mapper to read general information on a collection field
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * 
+ */
+public class CollectionDescriptor
+{
+
+     private String fieldName;
+     private String jcrName;     
+     private String elementClassName; 
+     private String collectionConverterClassName;
+     private String collectionClassName;
+     private boolean proxy;
+     private String jcrNodeType;
+     private boolean jcrAutoCreated;
+     private boolean jcrMandatory;
+     private String jcrOnParentVersion;
+     private boolean jcrProtected;
+     private boolean jcrSameNameSiblings;     
+     
+     private ClassDescriptor classDescriptor;
+    
+    /**
+     * @return Returns the fieldName.
+     */
+    public String getFieldName()
+    {
+        return fieldName;
+    }
+    /**
+     * @param fieldName The fieldName to set.
+     */
+    public void setFieldName(String fieldName)
+    {
+        this.fieldName = fieldName;
+    }
+    /**
+     * @return Returns the jcrName.
+     */
+    public String getJcrName()
+    {
+        return jcrName;
+    }
+    /**
+     * @param jcrName The jcrName to set.
+     */
+    public void setJcrName(String jcrName)
+    {
+        this.jcrName = jcrName;
+    }
+    
+    
+    /**
+     * @return Returns the elementClassName.
+     */
+    public String getElementClassName()
+    {
+        return elementClassName;
+    }
+    /**
+     * @param elementClassName The collection element class name to set.
+     *
+     */
+    public void setElementClassName(String elementClassName)
+    {
+        this.elementClassName = elementClassName;
+    }
+
+    /**
+     * @return Returns the proxy.
+     */
+    public boolean isProxy()
+    {
+        return proxy;
+    }
+    /**
+     * @param proxy The proxy to set.
+     */
+    public void setProxy(boolean proxy)
+    {
+        this.proxy = proxy;
+    }
+    
+    /**
+     * 
+     * @return The collection converter class name 
+     */
+    public String getCollectionConverterClassName()
+    {
+        return collectionConverterClassName;
+    }
+    
+    /**
+     * Set the collection converter class name
+     * @param collectionConverterClassName The converter to set
+     */
+    public void setCollectionConverterClassName(String collectionConverterClassName)
+    {
+        this.collectionConverterClassName = collectionConverterClassName;
+    }
+    
+    /**
+     *  
+     * @return the collection class name (can be also a Map)
+     */
+    public String getCollectionClassName()
+    {
+        return collectionClassName;
+    }
+    
+    /**
+     * Set the collection class name. 
+     * This collection class has to implement {@link org.apache.portals.graffito.jcr.persistence.collectionconverter.ManageableCollection}
+     * @param collectionClassName The collection class name to set
+     */
+    public void setCollectionClassName(String collectionClassName)
+    {
+        this.collectionClassName = collectionClassName;
+    }
+    
+    /**
+     * 
+     * @return The associated class descriptor
+     */
+    public ClassDescriptor getClassDescriptor()
+    {
+        return classDescriptor;
+    }
+    
+    /**
+     * Set the associated class descriptor
+     * @param classDescriptor the class descriptor to set 
+     */
+    public void setClassDescriptor(ClassDescriptor classDescriptor)
+    {
+        this.classDescriptor = classDescriptor;
+    }
+    
+    /** Getter for property jcrNodeType.
+     * 
+     * @return jcrNodeType
+     */
+    public String getJcrNodeType()
+    {
+        return jcrNodeType;
+    }
+
+    /** Setter for property jcrNodeType.
+     * 
+     * @param value jcrNodeType
+     */
+    public void setJcrNodeType(String value)
+    {
+        this.jcrNodeType = value;
+    }
+
+    /** Getter for property jcrAutoCreated.
+     * 
+     * @return jcrAutoCreated
+     */
+    public boolean isJcrAutoCreated()
+    {
+        return jcrAutoCreated;
+    }
+
+    /** Setter for property jcrAutoCreated.
+     * 
+     * @param value jcrAutoCreated
+     */
+    public void setJcrAutoCreated(boolean value)
+    {
+        this.jcrAutoCreated = value;
+    }
+
+    /** Getter for property jcrMandatory.
+     * 
+     * @return jcrMandatory
+     */
+    public boolean isJcrMandatory()
+    {
+        return jcrMandatory;
+    }
+
+    /** Setter for property jcrMandatory.
+     * 
+     * @param value jcrMandatory
+     */
+    public void setJcrMandatory(boolean value)
+    {
+        this.jcrMandatory = value;
+    }
+
+    /** Getter for property jcrOnParentVersion.
+     * 
+     * @return jcrOnParentVersion
+     */
+    public String getJcrOnParentVersion()
+    {
+        return jcrOnParentVersion;
+    }
+
+    /** Setter for property jcrOnParentVersion.
+     * 
+     * @param value jcrOnParentVersion
+     */
+    public void setJcrOnParentVersion(String value)
+    {
+        this.jcrOnParentVersion = value;
+    }
+
+    /** Getter for property jcrProtected.
+     * 
+     * @return jcrProtected
+     */
+    public boolean isJcrProtected()
+    {
+        return jcrProtected;
+    }
+
+    /** Setter for property jcrProtected.
+     * 
+     * @param value jcrProtected
+     */
+    public void setJcrProtected(boolean value)
+    {
+        this.jcrProtected = value;
+    }
+
+    /** Getter for property jcrSameNameSiblings.
+     * 
+     * @return jcrSameNameSiblings
+     */
+    public boolean isJcrSameNameSiblings()
+    {
+        return jcrSameNameSiblings;
+    }
+
+    /** Setter for property jcrSameNameSiblings.
+     * 
+     * @param value jcrSameNameSiblings
+     */
+    public void setJcrSameNameSiblings(boolean value)
+    {
+        this.jcrSameNameSiblings = value;
+    }    
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2000-2005 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.mapper.model;
+
+/**
+ * 
+ *
+ * FieldDescriptor is used by the mapper to read general information on a atomic field
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ *
+ */
+public class FieldDescriptor
+{
+     private String fieldName;
+     private String jcrName;
+     private String jcrType;
+     private boolean jcrAutoCreated;
+     private boolean jcrMandatory;
+     private String jcrOnParentVersion;
+     private boolean jcrProtected;
+     private boolean jcrMultiple;
+     private ClassDescriptor classDescriptor;
+     private boolean id;
+     private boolean path;
+     
+    /**
+     * @return Returns the fieldName.
+     */
+    public String getFieldName()
+    {
+        return fieldName;
+    }
+
+    /**
+     * @param fieldName The fieldName to set.
+     */
+    public void setFieldName(String fieldName)
+    {
+        this.fieldName = fieldName;
+    }
+
+    /**
+     * @return Returns the jcrName.
+     */
+    public String getJcrName()
+    {
+        return jcrName;
+    }
+
+    /**
+     * @param jcrName The jcrName to set.
+     */
+    public void setJcrName(String jcrName)
+    {
+        this.jcrName = jcrName;
+    }
+    
+    /**
+     * 
+     * @return the associated class descriptor
+     */
+    public ClassDescriptor getClassDescriptor()
+    {
+        return classDescriptor;
+    }
+    
+    /**
+     * Set the associated class descriptor 
+     * @param classDescriptor  the class descriptor to set
+     */
+    public void setClassDescriptor(ClassDescriptor classDescriptor)
+    {
+        this.classDescriptor = classDescriptor;
+    }
+    
+    /**    
+     * @return true if the field is the class ID 
+     */
+    public boolean isId()
+    {
+        return id;
+    }
+    
+    /**
+     * 
+     * @param id
+     */
+    public void setId(boolean id)
+    {
+        this.id = id;
+    }
+
+	/**
+	 * @return Returns true if the field is the object JCR path.
+	 */
+	public boolean isPath()
+	{
+		return path;
+	}
+
+	/**
+	 * @param path The path to set.
+	 */
+	public void setPath(boolean path)
+	{
+		this.path = path;
+	}
+
+    /** Getter for property jcrType.
+     * 
+     * @return jcrType
+     */
+    public String getJcrType()
+    {
+        return jcrType;
+    }
+
+    /** Setter for property jcrType.
+     * 
+     * @param value jcrType
+     */
+    public void setJcrType(String value)
+    {
+        this.jcrType = value;
+    }
+
+    /** Getter for propery jcrAutoCreated.
+     * 
+     * @return jcrAutoCreated
+     */
+    public boolean isJcrAutoCreated()
+    {
+        return jcrAutoCreated;
+    }
+
+    /** Setter for property jcrAutoCreated.
+     * 
+     * @param value jcrAutoCreated
+     */
+    public void setJcrAutoCreated(boolean value)
+    {
+        this.jcrAutoCreated = value;
+    }
+
+    /** Getter for property jcrMandatory.
+     * 
+     * @return jcrMandatory
+     */
+    public boolean isJcrMandatory()
+    {
+        return jcrMandatory;
+    }
+
+    /** Setter for property jcrMandatory.
+     * 
+     * @param value jcrMandatory
+     */
+    public void setJcrMandatory(boolean value)
+    {
+        this.jcrMandatory = value;
+    }
+
+    /** Getter for property jcrOnParentVersion.
+     * 
+     * @return jcrOnParentVersion
+     */
+    public String getJcrOnParentVersion()
+    {
+        return jcrOnParentVersion;
+    }
+
+    /** Setter for property jcrOnParentVersion.
+     * 
+     * @param value jcrOnParentVersion
+     */
+    public void setJcrOnParentVersion(String value)
+    {
+        this.jcrOnParentVersion = value;
+    }
+
+    /** Getter for property jcrProtected.
+     * 
+     * @return jcrProtected
+     */
+    public boolean isJcrProtected()
+    {
+        return jcrProtected;
+    }
+
+    /** Setter for property jcrProtected.
+     * 
+     * @param value jcrProtected
+     */
+    public void setJcrProtected(boolean value)
+    {
+        this.jcrProtected = value;
+    }
+
+    /** Getter for property jcrMultiple.
+     * 
+     * @return jcrMultiple
+     */
+    public boolean isJcrMultiple()
+    {
+        return jcrMultiple;
+    }
+
+    /** Setter for property jcrMultiple.
+     * 
+     * @param value jcrMultiple
+     */
+    public void setJcrMultiple(boolean value)
+    {
+        this.jcrMultiple = value;
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2005 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.mapper.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This class match to the complete xml mapping files.
+ * it contains mainly a collection of {@link ClassDescriptor}
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class MappingDescriptor
+{
+    private HashMap classDescriptors = new HashMap();
+    
+    /**
+     * Add a new ClassDescriptor
+     * 
+     * @param classDescriptor The class descriptor to add
+     */
+    public void addClassDescriptor(ClassDescriptor classDescriptor)
+    {
+        classDescriptors.put(classDescriptor.getClassName(), classDescriptor);
+    }
+    
+    /**
+     * Get the classdescriptor to used for the class 
+     * @param className the class name 
+     * @return the class descriptor found or null
+     */
+    public ClassDescriptor getClassDescriptor(String className)
+    {
+        return (ClassDescriptor) classDescriptors.get(className);
+    }
+    
+    /**
+     * Get all class descriptors 
+     * @return all class descriptors found
+     */
+    public Map getClassDescriptors()
+    {
+    	return classDescriptors;
+    }
+
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/CustomNodeTypeCreator.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/CustomNodeTypeCreator.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/CustomNodeTypeCreator.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/CustomNodeTypeCreator.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-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.persistence;
+
+import org.apache.portals.graffito.jcr.exception.CustomNodeTypeCreationException;
+import org.apache.portals.graffito.jcr.persistence.impl.PersistenceManagerImpl;
+
+/** Interface for custom node type creator implementations.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ * @version $Id: Exp $
+ */
+public interface CustomNodeTypeCreator {
+
+    /** This method is supposed to create custom node types on repository
+     * setup.
+     * 
+     * @throws org.apache.portals.graffito.jcr.exception.CustomNodeTypeCreationException 
+     * @return true/false True if custom node type creation succeeded 
+     */
+    boolean createInitialJcrCustomNodeTypes() throws CustomNodeTypeCreationException;
+
+    /** Method to add a jcr custom node type to an existing jcr repository.
+     * 
+     * @throws org.apache.portals.graffito.jcr.exception.CustomNodeTypeCreationException 
+     * @return true/false True if custom node type creation succeeded
+     */
+    boolean addJcrCustomNodeType() throws CustomNodeTypeCreationException;
+    
+    /** Jcr session to be injected into implementation.
+     * @param jcrSession JcrSession
+     */
+    void setJcrSession(PersistenceManagerImpl jcrSession);
+}

Added: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java?rev=354166&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java (added)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java Mon Dec  5 12:35:57 2005
@@ -0,0 +1,291 @@
+/*
+ * Copyright 2000-2005 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.persistence;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.jcr.version.VersionException;
+
+import org.apache.portals.graffito.jcr.exception.CannotUnlockException;
+import org.apache.portals.graffito.jcr.exception.LockedException;
+import org.apache.portals.graffito.jcr.exception.PersistenceException;
+import org.apache.portals.graffito.jcr.query.Query;
+import org.apache.portals.graffito.jcr.version.Version;
+import org.apache.portals.graffito.jcr.version.VersionIterator;
+
+/**
+ * The persistence manager encapsulates a JCR session. 
+ * This is the main component used to manage objects into the JCR repository.
+ * 
+ * @author Sandro Boehme 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * 
+ */
+public interface PersistenceManager
+{
+    
+    /**
+     * Check if an object exists
+     * @param path the object path 
+     * @return true if the item exists
+     * @throws PersistenceException when it is not possible to check if the item exist
+     */
+    public boolean objectExists(String path) throws PersistenceException;
+
+    
+    /**
+     * Can this persistence manager insert, update, delete, ... that type?
+     * 
+     * @param clazz class for question
+     * @return <code>true</code> if the class is persistence
+     */
+     boolean isPersistent(Class clazz);
+     
+     
+    /**
+     * Insert an object into the JCR repository
+     * 
+     * @param object the object to add    
+     * @throws PersistenceException when it is not possible to insert the object 
+     */
+    public void insert(Object object) throws PersistenceException;
+
+    /**
+     * Update an object 
+     *
+     * @param object the object to update 
+     * @throws PersistenceException when it is not possible to update the object
+     */
+    public void update(Object object) throws PersistenceException;
+
+    /**
+     * Get an object from the JCR repository 
+     * @param objectClass the object class
+     * @param path the object path
+     * @return the object found or null
+     * 
+     * @throws PersistenceException when it is not possible to retrieve the object 
+     */
+    public Object getObject(Class objectClass, String path) throws PersistenceException;
+
+    /**
+     * Get an object from the JCR repository 
+     * @param objectClass the object class
+     * @param path the object path
+     * @param versionNumber The desired object version number
+     * @return the object found or null
+     * 
+     * @throws PersistenceException when it is not possible to retrieve the object 
+     */
+    public Object getObject(Class objectClass, String path, String versionNumber) throws PersistenceException;
+    
+    
+    /**
+     * Remove an object from a JCR repository
+     * @param path the object path
+     * @throws PersistenceException when it is not possible to remove the object 
+     * 
+     */
+    public void remove(String path) throws PersistenceException;
+    
+    
+    /**
+     * Remove an object from a JCR repository
+     * @param object the object to remove
+     * @throws PersistenceException when it is not possible to remove the object 
+     * 
+     */
+    public void remove(Object object) throws PersistenceException;
+    
+    /**
+     * Remove all objects matching to a query
+     * @param query The query used to find the objects to remove
+     * @throws PersistenceException when it is not possible to remove all objects 
+     * 
+     */
+    public void remove(Query query) throws PersistenceException;
+
+    
+    /**
+     * Retrieve an object matching to a query     
+     * @param query The Graffito Query object used to seach the object
+     * @return The object found or null
+     * @throws PersistenceException when it is not possible to retrieve the object 
+     * 
+     */
+    public Object getObject(Query query) throws PersistenceException;
+
+    
+    /**
+     * Retrieve some objects matching to a query     
+     * @param query The query used to seach the objects
+     * @return a collection of objects found
+     * @throws PersistenceException when it is not possible to retrieve the objects 
+     * 
+     */
+    public Collection getObjects(Query query) throws PersistenceException;
+    
+    
+    /**
+     * Retrieve some objects matching to a query. 
+     *  
+     * @param query The query used to seach the objects
+     * @return an iterator of objects found
+     * @throws PersistenceException when it is not possible to retrieve the objects 
+     */
+    public Iterator getObjectIterator (Query query) throws PersistenceException;
+     
+    
+    /**
+     * Checkout - Create a new version
+     * This is only possible if the object is based on mix:versionable node type
+     *  
+     * @param path The object path
+     * @throws VersionException when it is not possible to create a new version 
+     */
+    public void checkout(String path) throws VersionException;
+    
+    /**
+     * Checkin an object
+     * @param path the object path 
+     * @throws VersionException when it is not possible to checkin
+     */
+    public void checkin(String path) throws VersionException;
+    
+    /**
+     * Checkin an object and apply some labels to this new version 
+     * Within a particular object path, a given label may appear a maximum of once
+     * @param path The object path 
+     * @param versionLabels the version labels to apply to the new version 
+     * @throws VersionException when it is possible to checkin
+     */
+    public void checkin(String path, String[] versionLabels) throws VersionException;
+    
+    
+    /**
+     * Get all version labels assigned to a particular object version 
+     * @param path the object path
+     * @param versionName the object version name (1.0, ...) 
+     * @return a array of string (version labels) 
+     * @throws VersionException when it is not to get all version labels
+     */
+    public String[] getVersionLabels(String path, String versionName) throws VersionException;
+    
+    
+    /**
+     * Get all version labels assigned to all versions 
+     * @param path the object path     
+     * @return a array of string (version labels) 
+     * @throws VersionException when it is not to get all version labels
+     */
+    public String[] getAllVersionLabels(String path) throws VersionException;    
+    
+    /**
+     * Add  a new label to a particular version  
+     * @param path the object path
+     * @param versionName the object versio name (1.0, 1.1, ...) 
+     * @param versionLabel The new label to apply
+     * @throws VersionException when it is not possible to add a new version label to this version
+     */
+    public void addVersionLabel(String path, String versionName, String versionLabel) throws VersionException;   
+    
+        
+    /**
+     * Get all object versions 
+     * @param path the object path
+     * @return a version iterator
+     * @throws VersionException when it is not possible to retrieve all versions
+     */
+    public VersionIterator getAllVersions(String path) throws VersionException;
+    
+    /**
+     * Get the first object version 
+     * @param path the object path
+     * @return the first version found
+     * @throws VersionException when it is not possible to get the root version 
+     */
+    public Version getRootVersion(String path) throws VersionException;
+    
+    /**
+     * Get the lastest object version 
+     * @param path the object path
+     * @return the last version found 
+     * @throws VersionException when it is not possible to get the last version 
+     */
+    public Version getBaseVersion(String path) throws VersionException;
+    /**
+     * Get a particular version
+     * @param path the object path
+     * @param versionName the version name
+     * @return the version found or null 
+     * @throws VersionException when it is not possible to retrieve this particular version 
+     */
+    public Version getVersion(String path, String versionName) throws VersionException;
+    
+
+    /**
+     * Save all modifications made by the persistence manager
+     *
+     * @throws PersistenceException when it is not possible to save all pending operation into the JCR repo 
+     */
+    public void save() throws PersistenceException;  
+    
+    /**
+     * Close the session    
+     * @throws PersistenceException when it is not possible to logout
+     */
+    public void logout() throws PersistenceException;
+    
+    /**
+     * Lock object saved on {@param path }.
+     * 
+     * @param path
+     *            path to saved object.
+     * @param isDeep
+     *            is lock deep? See JCR spec: 8.4.3 Shallow and Deep Locks
+     * @param isSessionScoped
+     *            is lock session scoped? See JCR spec: Session-scoped and Open-scoped Locks
+     * @return lock token - see JCR spec: 8.4.6 Lock Token; Other user  with this token can perform unlock
+     * 
+     * @throws LockedException
+     *             if path is locked (cannot lock same path again)
+     */
+    String lock(String path, boolean isDeep, boolean isSessionScoped) throws LockedException;
+    
+    /**
+     * Unlock object stored on {@param path }.
+     *  
+     * @param path path to stored object
+     * 
+     * 
+     * @param lockToken
+     *            see JCR spec: 8.4.6 Lock Token; can be <code>null</code>
+     * 
+     * @throws CannotUnlockException
+     *             if you have not lock token to unlock
+     */
+    void unlock(String path, String lockToken) throws CannotUnlockException;
+    
+    /**
+     * Is that path locked?
+     * 
+     * @param absPath
+     * @return <code>true</code> if path locked
+     */
+    boolean isLocked(String absPath);
+        
+}
\ No newline at end of file



Mime
View raw message