jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1346786 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
Date Wed, 06 Jun 2012 08:51:08 GMT
Author: jukka
Date: Wed Jun  6 08:51:07 2012
New Revision: 1346786

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

Slightly improved registerNodeTypes() methods, still far from correct

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java?rev=1346786&r1=1346785&r2=1346786&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
Wed Jun  6 08:51:07 2012
@@ -43,6 +43,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
@@ -158,12 +159,24 @@ public class NodeTypeManagerImpl impleme
 
     @Override
     public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws
RepositoryException {
-        return getNodeType("nt:base"); // FIXME OAK-66
+        // TODO proper node type registration... (OAK-66)
+        NodeTypeDelegate delegate = new NodeTypeDelegate(
+                ntd.getName(),
+                ntd.getDeclaredSupertypeNames(), ntd.getPrimaryItemName(),
+                ntd.isMixin(), ntd.isAbstract(), ntd.hasOrderableChildNodes());
+        NodeType type = new NodeTypeImpl(this, vf, mapper, delegate);
+        typemap.put(ntd.getName(), type);
+        return type;
     }
 
     @Override
     public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate)
throws RepositoryException {
-        return NodeTypeIteratorAdapter.EMPTY; // FIXME OAK-66
+        // TODO handle inter-type dependencies (OAK-66)
+        NodeType[] types = new NodeType[ntds.length];
+        for (int i = 0; i < ntds.length; i++) {
+            types[i] = registerNodeType(ntds[i], allowUpdate);
+        }
+        return new NodeTypeIteratorAdapter(Arrays.asList(types));
     }
 
     @Override



Mime
View raw message