incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r354174 - in /incubator/graffito/trunk/jcr/jcr-nodemanagement/src: ./ config/ config/jackrabbit/ config/jeceira/ java/ java/org/ java/org/apache/ java/org/apache/portals/ java/org/apache/portals/graffito/ java/org/apache/portals/graffito/jc...
Date Mon, 05 Dec 2005 20:39:29 GMT
Author: clombart
Date: Mon Dec  5 12:39:02 2005
New Revision: 354174

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

Added:
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/jaas.config
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/nodetypes_test1.xml
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository.xml
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository_derby.xml
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jeceira/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jeceira/jeceira.xml
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/NodeTypeManager.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/RepositorySession.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/BaseNodeManagementException.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NamespaceCreationException.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeCreationException.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeRemovalException.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/OperationNotSupportedException.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JackrabbitRepositorySession.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JeceiraRepositorySession.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositoryConfiguration.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositorySessionFactory.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NamespaceHelper.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NodeTypeManagerImpl.java
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jeceira/
    incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jeceira/NodeTypeManagerImpl.java

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/jaas.config
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/jaas.config?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/jaas.config (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/jaas.config Mon Dec  5 12:39:02 2005
@@ -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/jcr-nodemanagement/src/config/jackrabbit/nodetypes_test1.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/nodetypes_test1.xml?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/nodetypes_test1.xml (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/nodetypes_test1.xml Mon Dec  5 12:39:02 2005
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+/*
+ * 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.
+ */
+ -->
+<nodeTypes
+    xmlns:rep="internal"
+    xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
+    xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+    xmlns:jcr="http://www.jcp.org/jcr/1.0"
+    xmlns:graffito="http://incubator.apache.org/graffito">           
+
+  <nodeType name="graffito:test1" isMixin="false" hasOrderableChildNodes="false" primaryItemName="test1">
+        <supertypes>
+            <supertype>nt:base</supertype>
+        </supertypes>
+
+        <propertyDefinition name="graffito:testProperty" requiredType="String" autoCreated="false" mandatory="false"
+        onParentVersion="IGNORE" protected="false" multiple="false"/>
+  </nodeType>
+</nodeTypes>

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository.xml?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository.xml (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository.xml Mon Dec  5 12:39:02 2005
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!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="com.day.jackrabbit.fs.cq.CQFileSystem">
+            <param name="path" value="${wsp.home}/wspStore.dat"/>
+            <param name="autoRepair" value="false"/>
+            <param name="blockSize" value="128"/>
+            <param name="autoSync" value="false"/>
+        </FileSystem>
+        -->
+
+        <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.xml.XMLPersistenceManager"/>
+        
+        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+            <param name="useCompoundFile" value="true"/>
+            <param name="minMergeDocs" value="1000"/>
+            <param name="maxMergeDocs" value="100000"/>
+            <param name="mergeFactor" value="10"/>
+            <param name="bufferSize" value="10"/>
+            <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="com.day.jackrabbit.fs.cq.CQFileSystem">
+            <param name="path" value="${rep.home}/version/version.dat"/>
+            <param name="autoRepair" value="false"/>
+            <param name="blockSize" value="128"/>
+            <param name="autoSync" value="false"/>
+        </FileSystem>
+         -->
+        
+            <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+                <param name="path" value="${rep.home}/version"/>
+            </FileSystem>
+        
+        <!--
+            Configures the perisistence 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.obj.ObjectPersistenceManager"/>
+
+    </Versioning>
+</Repository>

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository_derby.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository_derby.xml?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository_derby.xml (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jackrabbit/repository_derby.xml Mon Dec  5 12:39:02 2005
@@ -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)>
+    <!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.db.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+          <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+        </PersistenceManager>
+        <!--
+            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.db.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
+          <param name="schemaObjectPrefix" value="version_"/>
+        </PersistenceManager>
+
+    </Versioning>
+</Repository>

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jeceira/jeceira.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jeceira/jeceira.xml?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jeceira/jeceira.xml (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/config/jeceira/jeceira.xml Mon Dec  5 12:39:02 2005
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jeceira>
+    <repositories>
+        <repository name="test" persistenceFactory="com.jeceira.persistence.hsqldb.HsqldbFactory">
+            <properties>
+                <property name="url" value="jdbc:hsqldb:file:./target/jeceira/testrepo" />
+                <property name="username" value="sa" />
+                <property name="password" value='' />
+            </properties>
+            <workspaces>
+                <workspace name="testworkspace" />
+            </workspaces>
+        </repository>
+    </repositories>
+</jeceira>

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/NodeTypeManager.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/NodeTypeManager.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/NodeTypeManager.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/NodeTypeManager.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,179 @@
+/*
+ * 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.nodemanagement;
+
+import java.io.InputStream;
+import java.util.List;
+
+import javax.jcr.Session;
+
+import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.MappingDescriptor;
+
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NamespaceCreationException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NodeTypeCreationException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NodeTypeRemovalException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.OperationNotSupportedException;
+
+/** This interface defines the API for JCR Node Type Management implementations.
+ * It does not contain any JCR vendor specific methods.
+ *
+ * Classes that implement this interface are used to create custom node types in
+ * a JCR repository. Each JCR repository has its own way of doing this as it is
+ * not defined by the JSR-170 spec. The default implementation of graffito
+ * jcr-nodemanagement is Jackrabbit.
+ *
+ * In order to create JCR custom node types you need to provide an established
+ * session to a JCR repository. The user that is logged into has to have the
+ * necessary permissions to create nodes (user has to have "superuser" rights).
+ *
+ * The JCR Node Type Management tools are an extension to the graffito jcr-mapping
+ * tools. NodeTypeManager implementations depend on the graffito jcr-mapping
+ * xml file and the object model defined by graffito jcr-mapping.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public interface NodeTypeManager {
+    
+    /** Creates a new namespace in the repository.
+     *
+     * @param namespace Namespace
+     * @param namespaceUri Full namespace URI
+     */
+    void createNamespace(Session session, String namespace, String namespaceUri)
+    throws NamespaceCreationException;
+    
+    /** This method creates JCR node types based on the MappingDescriptor object
+     * which is created by a graffito jcr-mapping Mapper implementation. A
+     * Mapper reads one to many graffito-jcr mapping XML File.
+     *
+     * @param session Repository session
+     * @param mappingDescriptor Mapping descriptor object created by graffito
+     * jcr-mapping
+     * @throws NodeTypeCreationException NodeTypeCreationException
+     */
+    void createNodeTypes(Session session, MappingDescriptor mappingDescriptor)
+    throws NodeTypeCreationException;
+    
+    /** This method creates JCR node types based on ClassDescriptor objects
+     * which are created by a graffito jcr-mapping Mapper implementation. A
+     * Mapper reads one to many graffito-jcr mapping XML File.
+     *
+     * @param session Repository session
+     * @param classDescriptors Array of ClassDescriptor objects created by
+     * graffito jcr-mapping
+     * @throws NodeTypeCreationException NodeTypeCreationException
+     */
+    void createNodeTypes(Session session, ClassDescriptor[] classDescriptors)
+    throws NodeTypeCreationException;
+    
+    /** This method creates JCR node types based on graffito jcr-mapping xml
+     * files.
+     *
+     * @param session Repository session
+     * @param mappingXmlFiles InputStreams to graffito jcr-mapping xml files
+     * @throws NodeTypeCreationException NodeTypeCreationException
+     */
+    void createNodeTypesFromMappingFiles(Session session,
+            InputStream[] mappingXmlFiles)
+            throws NodeTypeCreationException;
+    
+    /** This method creates a single JCR node type identified by its ClassDescriptor
+     * read from the graffito-jcr mapping file.
+     *
+     * @param session Repository session
+     * @param classDescriptor ClassDescriptor object created by graffito jcr-mapping
+     * @param jcrNodeType Name of the class that needs to be created identified
+     * by its jcrNodeType name
+     * @throws NodeTypeCreationException NodeTypeCreationException
+     */
+    void createSingleNodeType(Session session, ClassDescriptor classDescriptor)
+    throws NodeTypeCreationException;
+    
+    /** This method creates a single JCR node type identified by its jcrNodeType
+     * name defined in a graffito jcr-mapping xml file.
+     *
+     * @param session Repository session
+     * @param mappingXmlFile InputStream to a graffito jcr-mapping xml file
+     * @param jcrNodeType Name of the class that needs to be created identified
+     * by its jcrNodeType name
+     * @throws NodeTypeCreationException NodeTypeCreationException
+     */
+    void createSingleNodeTypeFromMappingFile(Session session,
+            InputStream mappingXmlFile, String jcrNodeType)
+            throws NodeTypeCreationException;
+    
+    /** This method creates a JCR node type from a given Java Bean class by using
+     * reflection. It creates required JCR property definitions from primitive
+     * Java class properties using the same property name. Non-primitive class
+     * properties are skipped.
+     *
+     * @param session Repository session
+     * @param clazz Java class
+     * @param jcrNodeType Name of JCR node type (including namespace)
+     * @param reflectSuperClasses If true, all base classes are also reflected
+     * @throws NodeTypeCreationException NodeTypeCreationException
+     */
+    void createNodeTypeFromClass(Session session, Class clazz,
+            String jcrNodeType, boolean reflectSuperClasses)
+            throws NodeTypeCreationException;
+    
+    /** This method created JCR node types from a JCR vendor specific
+     * configuration file.
+     *
+     * @param session Repository session
+     * @param jcrRepositoryXmlConfigurationFile InputStream to file
+     * @throws OperationNotSupportedException OperationNotSupportedException
+     * @throws NodeTypeCreationException NodeTypeCreationException
+     */
+    void createNodeTypesFromConfiguration(Session session,
+            InputStream jcrRepositoryConfigurationFile)
+            throws OperationNotSupportedException, NodeTypeCreationException;
+    
+    /** This method removes all JCR node types that are defined in one to many
+     * graffito jcr-mapping XML files.
+     *
+     * @param session Repository session
+     * @param mappingXmlFiles InputStreams to graffito jcr-mapping xml file
+     * @throws NodeTypeRemovalException NodeTypeRemovalException
+     */
+    void removeNodeTypes(Session session, InputStream[] mappingXmlFiles)
+    throws NodeTypeRemovalException;
+    
+    /** This method removes a single JCR node type identified by its jcrNodeType
+     * name.
+     *
+     * @param session Repository session
+     * @param jcrNodeType
+     * @throws NodeTypeRemovalException NodeTypeRemovalException
+     */
+    void removeSingleNodeType(Session session, String jcrNodeType)
+    throws NodeTypeRemovalException;
+    
+    /** Returns the names of all node types in the repository identified by a
+     * given namespace.
+     *
+     * @param namespace Name of nodetypes to return
+     * @return list of matching JCR node types
+     */
+    List getPrimaryNodeTypeNames(Session session, String namespace);
+    
+    /** Returns a list of all JCR node types.
+     *
+     * @return list of all JCR node types
+     */
+    List getAllPrimaryNodeTypeNames(Session session);
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/RepositorySession.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/RepositorySession.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/RepositorySession.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/RepositorySession.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,38 @@
+/*
+ * 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.nodemanagement;
+
+import javax.jcr.Session;
+
+import org.apache.portals.graffito.jcr.nodemanagement.impl.RepositoryConfiguration;
+
+/** Represents to JCR repository connection parameter.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public interface RepositorySession
+{
+    
+    /** Connects to a JCR repository and returns a session to it.
+     * 
+     * @param username Username to connect to repository
+     * @param password Password
+     * @param configuration Repository configuration
+     * @return session
+     */
+    Session getSession(String username, String password,
+            RepositoryConfiguration configuration);
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/BaseNodeManagementException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/BaseNodeManagementException.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/BaseNodeManagementException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/BaseNodeManagementException.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,51 @@
+/*
+ * 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.nodemanagement.exception;
+
+/** Base exception for all JCR Node Type Management exceptions.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class BaseNodeManagementException extends Exception
+{
+
+    /** Root exception.
+     */
+    private Exception wrappedException;
+    
+    /** Creates a new instance of BaseNodeManagementException. */
+    public BaseNodeManagementException()
+    {
+    }
+
+    /** Getter for property wrappedException.
+     * 
+     * @return wrappedException
+     */
+    public Exception getWrappedException()
+    {
+        return wrappedException;
+    }
+
+    /** Setter for property wrappedException.
+     * 
+     * @param object wrappedException
+     */
+    public void setWrappedException(Exception object)
+    {
+        this.wrappedException = object;
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NamespaceCreationException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NamespaceCreationException.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NamespaceCreationException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NamespaceCreationException.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,37 @@
+/*
+ * 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.nodemanagement.exception;
+
+/** Exception that is thrown when a JCR namespace could not be created.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class NamespaceCreationException extends BaseNodeManagementException
+{
+
+    /** Creates a new instance of NamespaceCreationException. */
+    public NamespaceCreationException()
+    {
+    }
+    
+    /** Creates a new instance of NamespaceCreationException. 
+     * @param wrappedException Root exception
+     */
+    public NamespaceCreationException(Exception wrappedException)
+    {
+        setWrappedException(wrappedException);
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeCreationException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeCreationException.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeCreationException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeCreationException.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,37 @@
+/*
+ * 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.nodemanagement.exception;
+
+/** Exception that is thrown when a JCR node type could not be created.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class NodeTypeCreationException extends BaseNodeManagementException
+{
+    
+    /** Creates a new instance of NodeTypeCreationException. */
+    public NodeTypeCreationException()
+    {
+    }
+    
+    /** Creates a new instance of NodeTypeCreationException. 
+     * @param wrappedException Root exception
+     */
+    public NodeTypeCreationException(Exception wrappedException)
+    {
+        setWrappedException(wrappedException);
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeRemovalException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeRemovalException.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeRemovalException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/NodeTypeRemovalException.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,37 @@
+/*
+ * 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.nodemanagement.exception;
+
+/** Exception that is thrown when a JCR node type could not be removed.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class NodeTypeRemovalException extends BaseNodeManagementException
+{
+    
+    /** Creates a new instance of NodeTypeRemovalException. */
+    public NodeTypeRemovalException()
+    {
+    }
+    
+    /** Creates a new instance of NodeTypeRemovalException. 
+     * @param wrappedException Root exception
+     */
+    public NodeTypeRemovalException(Exception wrappedException)
+    {
+        setWrappedException(wrappedException);
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/OperationNotSupportedException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/OperationNotSupportedException.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/OperationNotSupportedException.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/exception/OperationNotSupportedException.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,38 @@
+/*
+ * 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.nodemanagement.exception;
+
+/** Exception that is thrown if a JCR operation is not supported by
+ * a JCR repository implementation.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class OperationNotSupportedException extends BaseNodeManagementException
+{
+    
+    /** Creates a new instance of NodeTypeRemovalException. */
+    public OperationNotSupportedException()
+    {
+    }
+    
+    /** Creates a new instance of NodeTypeRemovalException. 
+     * @param wrappedException Root exception
+     */
+    public OperationNotSupportedException(Exception wrappedException)
+    {
+        setWrappedException(wrappedException);
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JackrabbitRepositorySession.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JackrabbitRepositorySession.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JackrabbitRepositorySession.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JackrabbitRepositorySession.java Mon Dec  5 12:39:02 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.nodemanagement.impl;
+
+import javax.jcr.Repository;
+import javax.jcr.Session;
+
+import org.apache.portals.graffito.jcr.repository.RepositoryUtil;
+import org.apache.portals.graffito.jcr.nodemanagement.RepositorySession;
+
+/** This class is the Jackrabbit JCR Repository session implementation.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class JackrabbitRepositorySession implements RepositorySession
+{
+    
+    /** Creates a new instance of JackrabbitRepositorySession. */
+    public JackrabbitRepositorySession()
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.RepositorySession#getSession
+     */
+    public Session getSession(String username, String password,
+            RepositoryConfiguration configuration)
+    {
+
+        RepositoryUtil.registerRepository(configuration.getRepositoryName(),
+                configuration.getConfigurationFile(),
+                configuration.getRepositoryPath());
+        
+        Repository repository =
+                RepositoryUtil.getRepository(configuration.getRepositoryName());
+        
+        return RepositoryUtil.login(repository, username, password);
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JeceiraRepositorySession.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JeceiraRepositorySession.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JeceiraRepositorySession.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/JeceiraRepositorySession.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,59 @@
+/*
+ * 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.nodemanagement.impl;
+
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import com.jeceira.repository.RepositoryFactory;
+
+import org.apache.portals.graffito.jcr.nodemanagement.RepositorySession;
+
+/** This class is the Jeceira JCR Repository session implementation.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class JeceiraRepositorySession implements RepositorySession
+{
+    
+    /** Creates a new instance of JeceiraRepositorySession. */
+    public JeceiraRepositorySession()
+    {
+    }
+
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.RepositorySession#getSession
+     */    
+    public Session getSession(String username, String password,
+            RepositoryConfiguration configuration)
+    {
+        Session session = null;
+        
+        try {
+            RepositoryFactory repositoryFactory = RepositoryFactory.getInstance();
+            Repository repository = repositoryFactory.getRepository(configuration.getRepositoryName());
+            
+            session = repository.login();
+        }
+        catch (RepositoryException re)
+        {
+            re.printStackTrace();
+        }
+        
+        return session;
+    } 
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositoryConfiguration.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositoryConfiguration.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositoryConfiguration.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositoryConfiguration.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,113 @@
+/*
+ * 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.nodemanagement.impl;
+
+/**
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class RepositoryConfiguration
+{
+    
+    /**
+     */
+    private String configurationFile;
+    
+    /**
+     */
+    private String repositoryPath;
+    
+    /**
+     */
+    private String repositoryName;
+    
+    /**
+     */
+    private String workspaceName;
+    
+    /**
+     */
+    private boolean useJNDI;
+    
+    /**
+     */
+    private String jndiName;
+    
+    /** Creates a new instance of RepositoryConfiguration. */
+    public RepositoryConfiguration()
+    {
+    }
+
+    public String getConfigurationFile()
+    {
+        return configurationFile;
+    }
+
+    public void setConfigurationFile(String configurationFile)
+    {
+        this.configurationFile = configurationFile;
+    }
+
+    public String getRepositoryPath() 
+    {
+        return repositoryPath;
+    }
+
+    public void setRepositoryPath(String repositoryPath)
+    {
+        this.repositoryPath = repositoryPath;
+    }
+
+    public boolean isUseJNDI()
+    {
+        return useJNDI;
+    }
+
+    public void setUseJNDI(boolean useJNDI)
+    {
+        this.useJNDI = useJNDI;
+    }
+
+    public String getJndiName()
+    {
+        return jndiName;
+    }
+
+    public void setJndiName(String jndiName)
+    {
+        this.jndiName = jndiName;
+    }
+
+    public String getRepositoryName()
+    {
+        return repositoryName;
+    }
+
+    public void setRepositoryName(String repositoryName)
+    {
+        this.repositoryName = repositoryName;
+    }
+
+    public String getWorkspaceName()
+    {
+        return workspaceName;
+    }
+
+    public void setWorkspaceName(String workspaceName)
+    {
+        this.workspaceName = workspaceName;
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositorySessionFactory.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositorySessionFactory.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositorySessionFactory.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/RepositorySessionFactory.java Mon Dec  5 12:39:02 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.nodemanagement.impl;
+
+import javax.jcr.Session;
+
+/** Factory class to create a JCR repository session for different
+ * JCR implementations.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class RepositorySessionFactory {
+    
+    public static final String JACKRABBIT = "jackrabbit";
+    public static final String JECEIRA = "jeceira";
+
+    private static Session session;
+    
+    /**  
+     * Private constructor.
+     */
+    private RepositorySessionFactory()
+    {
+    }
+    
+    /** Returns a session to a JCR repository.
+     * 
+     * @param jcrRepository 
+     * @param username Username to logon
+     * @param password Password
+     * @return session JCR repository session
+     */
+    public static Session getSession(String jcrRepository,
+            String username, String password,
+            RepositoryConfiguration configuration)
+    {
+        
+        if (session == null)
+        {
+            if (jcrRepository != null)
+            {
+                if (jcrRepository.equals(JACKRABBIT))
+                {
+                    session = new JackrabbitRepositorySession().getSession(username, password, configuration);
+                }
+                else if (jcrRepository.equals(JECEIRA)) 
+                {
+                    session = new JeceiraRepositorySession().getSession(username, password, configuration); 
+                }
+            }
+        }
+
+        return session;
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NamespaceHelper.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NamespaceHelper.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NamespaceHelper.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NamespaceHelper.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,102 @@
+/*
+ * 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.nodemanagement.impl.jackrabbit;
+
+import javax.jcr.NamespaceRegistry;
+
+import org.apache.jackrabbit.core.nodetype.ItemDef;
+import org.apache.jackrabbit.name.QName;
+
+/** Jackrabbit namespace helper class.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class NamespaceHelper
+{
+    
+    /** JCR namespace registry.
+     */
+    private NamespaceRegistry registry;
+    
+    /** Creates a new instance of NamespaceHelper. */
+    public NamespaceHelper()
+    {
+    }
+
+    /** Returns a QName object from a given JCR item name.
+     * 
+     * @param nodeName JCR item name
+     * @return qName
+     */
+    public QName getQName(String itemName)
+    {
+        QName qName = null;
+        
+        if (itemName != null && itemName.length() > 0)
+        {
+            if (itemName.equals("*"))
+            {
+                qName = ItemDef.ANY_NAME;
+            }
+            else
+            {
+                String[] parts = itemName.split(":");
+                qName = new QName(getNamespaceUri(parts[0]),
+                        parts[1]); 
+            }
+        }
+        
+        return qName;
+    }
+
+    /** Returns the namespace URI from a given namespace prefix.
+     * 
+     * @param namespacePrefix 
+     * @return uri
+     */
+    public String getNamespaceUri(String namespacePrefix)
+    {    
+        String uri = null;
+        try
+        {
+            uri = getRegistry().getURI(namespacePrefix);
+        }
+        catch (Exception ne)
+        {
+            ne.printStackTrace();
+        }
+
+        return uri;
+    }
+    
+    /** Getter for property registry.
+     * 
+     * @return registry
+     */
+    public NamespaceRegistry getRegistry()
+    {
+        return registry;
+    }
+
+    /** Setter for property registry.
+     * 
+     * @param object registry
+     */
+    public void setRegistry(NamespaceRegistry object)
+    {
+        this.registry = object;
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NodeTypeManagerImpl.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NodeTypeManagerImpl.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jackrabbit/NodeTypeManagerImpl.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,338 @@
+/*
+ * 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.nodemanagement.impl.jackrabbit;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.jcr.PropertyType;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+import javax.jcr.version.OnParentVersionAction;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
+import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
+import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
+import org.apache.jackrabbit.core.nodetype.PropDef;
+import org.apache.jackrabbit.core.nodetype.PropDefImpl;
+import org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader;
+import org.apache.jackrabbit.name.QName;
+
+import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.FieldDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.MappingDescriptor;
+
+import org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NamespaceCreationException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NodeTypeCreationException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NodeTypeRemovalException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.OperationNotSupportedException;
+
+/** This is the NodeTypeManager implementation for Apache Jackrabbit.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class NodeTypeManagerImpl implements NodeTypeManager
+{
+    /**
+     * Logging.
+     */
+    private static Log log = LogFactory.getLog(NodeTypeManagerImpl.class);
+    
+    /**
+     */
+    private NamespaceHelper namespaceHelper = new NamespaceHelper();
+    
+    /** Creates a new instance of NodeTypeManagerImpl. */
+    public NodeTypeManagerImpl()
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createNamespace
+     */
+    public void createNamespace(Session session, String namespace, String namespaceUri)
+    throws NamespaceCreationException
+    {
+        if (session != null)
+        {
+            try
+            {
+                session.getWorkspace().getNamespaceRegistry().registerNamespace(namespace, namespaceUri);
+                log.info("Namespace created: " +
+                        "{" + namespaceUri + "}" + namespace);
+            }
+            catch (Exception e)
+            {
+                throw new NamespaceCreationException(e);
+            }
+        }
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypes
+     */    
+    public void createNodeTypes(Session session, MappingDescriptor mappingDescriptor)
+    throws NodeTypeCreationException
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypes
+     */     
+    public void createNodeTypes(Session session, ClassDescriptor[] classDescriptors)
+    throws NodeTypeCreationException
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypesFromMappingFiles
+     */       
+    public void createNodeTypesFromMappingFiles(Session session,
+            InputStream[] mappingXmlFiles)
+            throws NodeTypeCreationException
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createSingleNodeType
+     */ 
+    public void createSingleNodeType(Session session, ClassDescriptor classDescriptor)
+    throws NodeTypeCreationException
+    {
+        try
+        {
+            getNamespaceHelper().setRegistry(session.getWorkspace().getNamespaceRegistry());
+            ArrayList list = new ArrayList();
+            NodeTypeDef nodeTypeDef = getNodeTypeDef(classDescriptor.getJcrNodeType(),
+                        classDescriptor.getJcrSuperTypes());
+            
+            if (classDescriptor.getFieldDescriptors() != null)
+            {
+                Iterator fieldIterator = classDescriptor.getFieldDescriptors().iterator();
+                PropDef[] properties = new PropDef[classDescriptor.getFieldDescriptors().size()];
+                int i = 0;
+                while (fieldIterator.hasNext())
+                {
+                    FieldDescriptor field = (FieldDescriptor) fieldIterator.next();
+                    properties[i] = getPropertyDefinition(field,
+                            nodeTypeDef.getName());
+                    i++;
+                }
+                
+                nodeTypeDef.setPropertyDefs(properties);
+            }
+
+            list.add(nodeTypeDef);
+            createNodeTypesFromList(session, list);
+            log.info("Registered JCR node type '" + classDescriptor.getJcrNodeType() +
+                    "' for class '" + classDescriptor.getClassName() + "'");
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            log.error("Could not create node types from class descriptor.", e);
+            throw new NodeTypeCreationException(e);
+        }        
+    }
+    
+    /** Creates a NodeTypeDef object.
+     * 
+     * @param jcrNodeType Name of JCR node type
+     * @param jcrSuperTypes JCR node super types
+     * @return type
+     */
+    public NodeTypeDef getNodeTypeDef(String jcrNodeType, String jcrSuperTypes)
+    {
+        NodeTypeDef type = new NodeTypeDef();
+        type.setMixin(false);
+        type.setName(getNamespaceHelper().getQName(jcrNodeType));
+        type.setSupertypes(getJcrSuperTypes(jcrSuperTypes));
+        type.setPrimaryItemName(getNamespaceHelper().getQName(jcrNodeType));
+        return type;
+    }
+    
+    /** Creates a PropDefImpl object.
+     * 
+     * @param field Field descriptor
+     * @param declaringNodeType Node Type QName where the property belongs to
+     * @return property
+     */
+    public PropDefImpl getPropertyDefinition(FieldDescriptor field,
+            QName declaringNodeType)
+    {
+        PropDefImpl property = new PropDefImpl();
+        property.setName(getNamespaceHelper().getQName(field.getJcrName()));
+        property.setRequiredType(PropertyType.valueFromName(field.getJcrType()));
+        property.setDeclaringNodeType(declaringNodeType);
+        property.setAutoCreated(field.isJcrAutoCreated());
+        property.setMandatory(field.isJcrMandatory());
+        property.setMultiple(field.isJcrMultiple());
+        
+        if (field.getJcrOnParentVersion() != null &&
+                field.getJcrOnParentVersion().length() > 0)
+        {
+            property.setOnParentVersion(OnParentVersionAction.valueFromName(field.getJcrOnParentVersion()));
+        }
+        
+        property.setProtected(field.isJcrProtected());
+        return property;
+    }
+
+    /** Creates a QName array from a comma separated list of JCR super types in
+     * a given String.
+     * 
+     * @param superTypes JCR super types 
+     * @return qNameSuperTypes
+     */
+    public QName[] getJcrSuperTypes(String superTypes)
+    {
+        QName[] qNameSuperTypes = null;
+        if (superTypes != null && superTypes.length() > 0)
+        {
+            String[] superTypesArray = superTypes.split(",");
+            log.debug("JCR super types found: " + superTypesArray.length);
+            qNameSuperTypes = new QName[superTypesArray.length];
+            for (int i = 0; i < superTypesArray.length; i++)
+            {
+                String superTypeName = superTypesArray[i].trim();
+                qNameSuperTypes[i] = getNamespaceHelper().getQName(superTypeName);
+                log.debug("Setting JCR super type: " + superTypeName);
+            }
+        }
+
+        return qNameSuperTypes;
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createSingleNodeTypeFromMappingFile
+     */     
+    public void createSingleNodeTypeFromMappingFile(Session session,
+            InputStream mappingXmlFile, String jcrNodeType)
+            throws NodeTypeCreationException
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypeFromClass
+     */     
+    public void createNodeTypeFromClass(Session session, Class clazz,
+            String jcrNodeType, boolean reflectSuperClasses)
+            throws NodeTypeCreationException
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypesFromConfiguration
+     */  
+    public void createNodeTypesFromConfiguration(Session session,
+            InputStream jcrRepositoryConfigurationFile)
+            throws OperationNotSupportedException, NodeTypeCreationException
+    {
+        try
+        {
+            NodeTypeDef[] types = NodeTypeReader.read(jcrRepositoryConfigurationFile);
+
+            ArrayList list = new ArrayList();
+            for (int i = 0; i < types.length; i++)
+            {
+                list.add(types[i]);
+            }
+            
+            createNodeTypesFromList(session, list);
+            log.info("Registered " + list.size() + " nodetypes from xml configuration file.");
+        }
+        catch (Exception e)
+        {
+            log.error("Could not create node types from configuration file.", e);
+            throw new NodeTypeCreationException(e);
+        }
+    }
+    
+    /**
+     * 
+     * @param session 
+     * @param nodeTypes 
+     * @throws org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException 
+     * @throws javax.jcr.RepositoryException 
+     */
+    public void createNodeTypesFromList(Session session, List nodeTypes)
+    throws InvalidNodeTypeDefException, RepositoryException
+    {
+        Workspace wsp = session.getWorkspace();
+        javax.jcr.nodetype.NodeTypeManager ntMgr = wsp.getNodeTypeManager();
+        NodeTypeRegistry ntReg =
+                ((org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();
+        
+        ntReg.registerNodeTypes(nodeTypes);
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#removeNodeTypes
+     */     
+    public void removeNodeTypes(Session session, InputStream[] mappingXmlFiles)
+    throws NodeTypeRemovalException
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#removeSingleNodeType
+     */     
+    public void removeSingleNodeType(Session session, String jcrNodeType)
+    throws NodeTypeRemovalException
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#getPrimaryNodeTypeNames
+     */    
+    public List getPrimaryNodeTypeNames(Session session, String namespace)
+    {
+        return null;
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#getAllPrimaryNodeTypeNames
+     */    
+    public List getAllPrimaryNodeTypeNames(Session session)
+    {
+        return null;
+    }
+
+    /** Getter for property namespaceHelper.
+     * 
+     * @return namespaceHelper
+     */
+    public NamespaceHelper getNamespaceHelper()
+    {
+        return namespaceHelper;
+    }
+
+    /** Setter for property namespaceHelper.
+     * 
+     * @param object namespaceHelper
+     */
+    public void setNamespaceHelper(NamespaceHelper object)
+    {
+        this.namespaceHelper = object;
+    }
+}

Added: incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jeceira/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jeceira/NodeTypeManagerImpl.java?rev=354174&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jeceira/NodeTypeManagerImpl.java (added)
+++ incubator/graffito/trunk/jcr/jcr-nodemanagement/src/java/org/apache/portals/graffito/jcr/nodemanagement/impl/jeceira/NodeTypeManagerImpl.java Mon Dec  5 12:39:02 2005
@@ -0,0 +1,119 @@
+/*
+ * 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.nodemanagement.impl.jeceira;
+
+import java.io.InputStream;
+import java.util.List;
+
+import javax.jcr.Session;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor;
+import org.apache.portals.graffito.jcr.mapper.model.MappingDescriptor;
+import org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NamespaceCreationException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NodeTypeCreationException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.NodeTypeRemovalException;
+import org.apache.portals.graffito.jcr.nodemanagement.exception.OperationNotSupportedException;
+
+/** This is the NodeTypeManager implementation for Jeceira.
+ *
+ * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
+ */
+public class NodeTypeManagerImpl implements NodeTypeManager {
+    
+    /**
+     * Logging.
+     */
+    private static Log log = LogFactory.getLog(NodeTypeManagerImpl.class);
+    
+    /** Creates a new instance of NodeTypeManagerImpl. */
+    public NodeTypeManagerImpl()
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createNamespace
+     */
+    public void createNamespace(Session session, String namespace, String namespaceUri)
+    throws NamespaceCreationException
+    {
+    }
+    
+    public void createNodeTypes(Session session, MappingDescriptor mappingDescriptor)
+    throws NodeTypeCreationException
+    {
+    }
+    
+    public void createNodeTypes(Session session, ClassDescriptor[] classDescriptors)
+    throws NodeTypeCreationException
+    {
+    }
+    
+    public void createNodeTypesFromMappingFiles(Session session,
+            InputStream[] mappingXmlFiles)
+            throws NodeTypeCreationException
+    {
+    }
+    
+    public void createSingleNodeType(Session session, ClassDescriptor classDescriptor)
+    throws NodeTypeCreationException
+    {
+    }
+    
+    public void createSingleNodeTypeFromMappingFile(Session session,
+            InputStream mappingXmlFile, String jcrNodeType)
+            throws NodeTypeCreationException
+    {
+    }
+    
+    public void createNodeTypeFromClass(Session session, Class clazz,
+            String jcrNodeType, boolean reflectSuperClasses)
+            throws NodeTypeCreationException
+    {
+    }
+    
+    /**
+     * @see org.apache.portals.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypesFromConfiguration
+     */
+    public void createNodeTypesFromConfiguration(Session session,
+            InputStream jcrRepositoryConfigurationFile)
+            throws OperationNotSupportedException, NodeTypeCreationException
+    {
+    }
+    
+    public void removeNodeTypes(Session session, InputStream[] mappingXmlFiles)
+    throws NodeTypeRemovalException
+    {
+    }
+    
+    public void removeSingleNodeType(Session session, String jcrNodeType)
+    throws NodeTypeRemovalException
+    {
+    }
+    
+    public List getPrimaryNodeTypeNames(Session session, String namespace)
+    {
+        return null;
+    }
+    
+    public List getAllPrimaryNodeTypeNames(Session session)
+    {
+        return null;
+    }    
+}



Mime
View raw message