jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r770255 - /jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
Date Thu, 30 Apr 2009 14:47:42 GMT
Author: mduerig
Date: Thu Apr 30 14:47:41 2009
New Revision: 770255

URL: http://svn.apache.org/viewvc?rev=770255&view=rev
Log:
JCR-2070: jcr-server should respect child node definition of jcr:content

Modified:
    jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java

Modified: jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java?rev=770255&r1=770254&r2=770255&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
Thu Apr 30 14:47:41 2009
@@ -308,7 +308,14 @@
                 }
             }
             if (contentNode == null) {
-                contentNode = parentNode.addNode(JcrConstants.JCR_CONTENT, getContentNodeType());
+                if (parentNode.getPrimaryNodeType().canAddChildNode(JcrConstants.JCR_CONTENT,
+                        getContentNodeType())) {
+
+                    contentNode = parentNode.addNode(JcrConstants.JCR_CONTENT, getContentNodeType());
+                }
+                else {
+                    contentNode = parentNode.addNode(JcrConstants.JCR_CONTENT);
+                }
             }
         }
         return contentNode;



Mime
View raw message