jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1330761 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: NodeImpl.java SessionContext.java SessionImpl.java WorkspaceImpl.java nodetype/NodeTypeImpl.java
Date Thu, 26 Apr 2012 10:33:43 GMT
Author: jukka
Date: Thu Apr 26 10:33:42 2012
New Revision: 1330761

URL: http://svn.apache.org/viewvc?rev=1330761&view=rev
Log:
OAK-66: JCR Node Type Management

Connect the new NodeTypeManagerImpl to WorkspaceImpl.

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1330761&r1=1330760&r2=1330761&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Thu Apr 26 10:33:42 2012
@@ -583,7 +583,8 @@ public class NodeImpl extends ItemImpl i
         checkStatus();
 
         // TODO: check if transient changes to mixin-types are reflected here
-        NodeTypeManager ntMgr = sessionContext.getNodeTypeManager();
+        NodeTypeManager ntMgr =
+                getSession().getWorkspace().getNodeTypeManager();
         String primaryNtName = getProperty(JcrConstants.JCR_PRIMARYTYPE).getString();
         return ntMgr.getNodeType(primaryNtName);
     }
@@ -597,7 +598,8 @@ public class NodeImpl extends ItemImpl i
 
         // TODO: check if transient changes to mixin-types are reflected here
         if (hasProperty(JcrConstants.JCR_MIXINTYPES)) {
-            NodeTypeManager ntMgr = sessionContext.getNodeTypeManager();
+            NodeTypeManager ntMgr =
+                    getSession().getWorkspace().getNodeTypeManager();
             Value[] mixinNames = getProperty(JcrConstants.JCR_MIXINTYPES).getValues();
             NodeType[] mixinTypes = new NodeType[mixinNames.length];
             for (int i = 0; i < mixinNames.length; i++) {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java?rev=1330761&r1=1330760&r2=1330761&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
Thu Apr 26 10:33:42 2012
@@ -16,7 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.jackrabbit.oak.jcr;
 
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -28,7 +27,6 @@ import org.apache.jackrabbit.oak.namepat
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.lock.LockManager;
-import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.version.VersionManager;
 
 public interface SessionContext<T extends Session> {
@@ -39,7 +37,6 @@ public interface SessionContext<T extend
     ValueFactoryImpl getValueFactory();
     NameMapper getNameMapper();
     LockManager getLockManager() throws RepositoryException;
-    NodeTypeManager getNodeTypeManager() throws RepositoryException;
     VersionManager getVersionManager() throws RepositoryException;
     Root getBranch();
     Tree getContentTree(String path);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1330761&r1=1330760&r2=1330761&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Thu Apr 26 10:33:42 2012
@@ -30,7 +30,6 @@ import javax.jcr.UnsupportedRepositoryOp
 import javax.jcr.ValueFactory;
 import javax.jcr.Workspace;
 import javax.jcr.lock.LockManager;
-import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.retention.RetentionManager;
 import javax.jcr.security.AccessControlManager;
 import javax.jcr.version.VersionManager;
@@ -509,11 +508,6 @@ public class SessionImpl extends Abstrac
         }
 
         @Override
-        public NodeTypeManager getNodeTypeManager() throws RepositoryException {
-            return getWorkspace().getNodeTypeManager();
-        }
-
-        @Override
         public VersionManager getVersionManager() throws RepositoryException {
             return getWorkspace().getVersionManager();
         }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1330761&r1=1330760&r2=1330761&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Thu Apr 26 10:33:42 2012
@@ -21,7 +21,7 @@ import org.apache.jackrabbit.api.securit
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
-import org.apache.jackrabbit.oak.jcr.namespace.NamespaceRegistryImpl;
+import org.apache.jackrabbit.oak.jcr.nodetype.NodeTypeManagerImpl;
 import org.apache.jackrabbit.oak.jcr.query.QueryManagerImpl;
 import org.apache.jackrabbit.oak.jcr.security.privileges.PrivilegeManagerImpl;
 import org.apache.jackrabbit.oak.namepath.Paths;
@@ -55,12 +55,20 @@ public class WorkspaceImpl implements Ja
     private static final Logger log = LoggerFactory.getLogger(WorkspaceImpl.class);
 
     private final SessionContext<SessionImpl> sessionContext;
+
     private QueryManagerImpl queryManager;
+
     private final NamespaceRegistry nsRegistry;
 
-    public WorkspaceImpl(SessionContext<SessionImpl> sessionContext, NamespaceRegistry
nsRegistry) {        
+    private final NodeTypeManager nodeTypeManager;
+
+    public WorkspaceImpl(
+            SessionContext<SessionImpl> sessionContext,
+            NamespaceRegistry nsRegistry) {
         this.sessionContext = sessionContext;
         this.nsRegistry = nsRegistry;
+        this.nodeTypeManager =
+                new NodeTypeManagerImpl(sessionContext.getNameMapper());
     }
 
     //----------------------------------------------------------< Workspace >---
@@ -157,15 +165,13 @@ public class WorkspaceImpl implements Ja
     }
 
     @Override
-    public NamespaceRegistry getNamespaceRegistry() throws RepositoryException {
-        ensureIsAlive();
+    public NamespaceRegistry getNamespaceRegistry() {
         return nsRegistry;
     }
 
     @Override
-    public NodeTypeManager getNodeTypeManager() throws RepositoryException {
-        ensureIsAlive();
-        throw new UnsupportedRepositoryOperationException("TODO: Workspace.getNodeTypeManager");
+    public NodeTypeManager getNodeTypeManager() {
+        return nodeTypeManager;
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java?rev=1330761&r1=1330760&r2=1330761&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java
Thu Apr 26 10:33:42 2012
@@ -54,8 +54,6 @@ class NodeTypeImpl implements NodeType {
 
     private final List<NodeDefinition> declaredChildNodeDefinitions;
 
-    
-
     public NodeTypeImpl(
             NodeTypeManager manager, NameMapper mapper, String name,
             String[] declaredSuperTypeNames, boolean isAbstract,



Mime
View raw message