jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1478755 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype: NodeTypeConstants.java write/InitialContent.java
Date Fri, 03 May 2013 12:28:58 GMT
Author: angela
Date: Fri May  3 12:28:58 2013
New Revision: 1478755

URL: http://svn.apache.org/r1478755
Log:
minor improvement

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write/InitialContent.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java?rev=1478755&r1=1478754&r2=1478755&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java
Fri May  3 12:28:58 2013
@@ -37,6 +37,7 @@ public interface NodeTypeConstants exten
      */
     String NT_REP_ROOT = "rep:root";
     String NT_REP_SYSTEM = "rep:system";
+    String NT_REP_NODE_TYPES = "rep:nodeTypes";
 
     /**
      * Additional name constants not present in JcrConstants

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write/InitialContent.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write/InitialContent.java?rev=1478755&r1=1478754&r2=1478755&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write/InitialContent.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write/InitialContent.java
Fri May  3 12:28:58 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.oak.plugins.nodetype.write;
 
+import com.google.common.collect.ImmutableList;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
@@ -24,7 +25,9 @@ import org.apache.jackrabbit.oak.core.Ro
 import org.apache.jackrabbit.oak.plugins.index.IndexConstants;
 import org.apache.jackrabbit.oak.plugins.index.IndexUtils;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore;
+import org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants;
 import org.apache.jackrabbit.oak.plugins.nodetype.RegistrationEditorProvider;
+import org.apache.jackrabbit.oak.plugins.version.VersionConstants;
 import org.apache.jackrabbit.oak.spi.commit.EditorHook;
 import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
@@ -33,37 +36,29 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 
-import com.google.common.collect.ImmutableList;
-
-import static org.apache.jackrabbit.JcrConstants.JCR_MIXINTYPES;
-import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
-import static org.apache.jackrabbit.JcrConstants.JCR_SYSTEM;
-import static org.apache.jackrabbit.JcrConstants.JCR_UUID;
-import static org.apache.jackrabbit.JcrConstants.JCR_VERSIONSTORAGE;
-
 /**
  * {@code InitialContent} implements a {@link RepositoryInitializer} and
  * registers built-in node types when the micro kernel becomes available.
  */
 @Component
 @Service(RepositoryInitializer.class)
-public class InitialContent implements RepositoryInitializer {
+public class InitialContent implements RepositoryInitializer, NodeTypeConstants {
 
     @Override
     public NodeState initialize(NodeState state) {
         NodeBuilder root = state.builder();
-        root.setProperty(JCR_PRIMARYTYPE, "rep:root", Type.NAME);
+        root.setProperty(JCR_PRIMARYTYPE, NT_REP_ROOT, Type.NAME);
 
         if (!root.hasChildNode(JCR_SYSTEM)) {
             NodeBuilder system = root.child(JCR_SYSTEM);
-            system.setProperty(JCR_PRIMARYTYPE, "rep:system", Type.NAME);
+            system.setProperty(JCR_PRIMARYTYPE, NT_REP_SYSTEM, Type.NAME);
 
             system.child(JCR_VERSIONSTORAGE)
-                    .setProperty(JCR_PRIMARYTYPE, "rep:versionStorage", Type.NAME);
-            system.child("jcr:nodeTypes")
-                    .setProperty(JCR_PRIMARYTYPE, "rep:nodeTypes", Type.NAME);
-            system.child("jcr:activities")
-                    .setProperty(JCR_PRIMARYTYPE, "rep:Activities", Type.NAME);
+                    .setProperty(JCR_PRIMARYTYPE, VersionConstants.REP_VERSIONSTORAGE, Type.NAME);
+            system.child(JCR_NODE_TYPES)
+                    .setProperty(JCR_PRIMARYTYPE, NT_REP_NODE_TYPES, Type.NAME);
+            system.child(VersionConstants.JCR_ACTIVITIES)
+                    .setProperty(JCR_PRIMARYTYPE, VersionConstants.REP_ACTIVITIES, Type.NAME);
         }
 
         if (!root.hasChildNode(IndexConstants.INDEX_DEFINITIONS_NAME)) {



Mime
View raw message