jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1401605 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java
Date Wed, 24 Oct 2012 10:11:08 GMT
Author: mreutegg
Date: Wed Oct 24 10:11:08 2012
New Revision: 1401605

URL: http://svn.apache.org/viewvc?rev=1401605&view=rev
Log:
OAK-393: jcr:primaryType missing on /jcr:system/rep:namespaces

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java?rev=1401605&r1=1401604&r2=1401605&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistry.java
Wed Oct 24 10:11:08 2012
@@ -25,6 +25,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
 
+import static org.apache.jackrabbit.oak.api.Type.NAME;
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 
 /**
@@ -76,6 +77,10 @@ public abstract class ReadWriteNamespace
             Root root = getWriteRoot();
             Tree namespaces =
                     getOrCreate(root, JcrConstants.JCR_SYSTEM, REP_NAMESPACES);
+            if (!namespaces.hasProperty(JcrConstants.JCR_PRIMARYTYPE)) {
+                namespaces.setProperty(JcrConstants.JCR_PRIMARYTYPE,
+                        JcrConstants.NT_UNSTRUCTURED, NAME);
+            }
             // remove existing mapping to given uri
             for (PropertyState p : namespaces.getProperties()) {
                 if (!p.isArray() && p.getValue(STRING).equals(uri)) {



Mime
View raw message