jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r776737 - /jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
Date Wed, 20 May 2009 15:35:33 GMT
Author: jukka
Date: Wed May 20 15:35:32 2009
New Revision: 776737

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

Merged revision 770255 from the 1.5 branch.

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

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java?rev=776737&r1=776736&r2=776737&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
Wed May 20 15:35:32 2009
@@ -308,7 +308,15 @@
                 }
             }
             if (contentNode == null) {
-                contentNode = parentNode.addNode(JcrConstants.JCR_CONTENT, getContentNodeType());
+                // JCR-2070: Use the predefined content node type only
+                // when the underlying repository allows it to be used
+                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