jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r497019 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
Date Wed, 17 Jan 2007 13:54:17 GMT
Author: angela
Date: Wed Jan 17 05:54:16 2007
New Revision: 497019

URL: http://svn.apache.org/viewvc?view=rev&rev=497019
Log:
work in progress

- retrieve default nt from definition if not present with nodeInfo


Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java?view=diff&rev=497019&r1=497018&r2=497019
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
Wed Jan 17 05:54:16 2007
@@ -445,14 +445,19 @@
             log.debug("Skipping protected nodeState (" + nodeInfo.getName() + ")");
             return null;
         } else {
-            Operation an = AddNode.create(parent, nodeInfo.getName(), nodeInfo.getNodeTypeName(),
nodeInfo.getUUID());
+            QName ntName = nodeInfo.getNodeTypeName();
+            if (ntName == null) {
+                // use default node type
+                ntName = def.getDefaultPrimaryType();
+            }
+            Operation an = AddNode.create(parent, nodeInfo.getName(), ntName, nodeInfo.getUUID());
             stateMgr.execute(an);
             // retrieve id of state that has been created during execution of AddNode
             NodeState childState;
             try {
                 List cne = parent.getChildNodeEntries(nodeInfo.getName());
                 if (def.allowsSameNameSiblings()) {
-                    // TODO: find proper solution. problem with same-name-siblings
+                    // TODO TOBEFIXED find proper solution. problem with same-name-siblings
                     childState = ((ChildNodeEntry)cne.get(cne.size()-1)).getNodeState();
                 } else {
                     childState = ((ChildNodeEntry)cne.get(0)).getNodeState();



Mime
View raw message