jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r126478 - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: . nodetype version
Date Wed, 26 Jan 2005 07:17:54 GMT
Author: tripod
Date: Tue Jan 25 23:17:53 2005
New Revision: 126478

URL: http://svn.apache.org/viewcvs?view=rev&rev=126478
Log:
- jcr:versionStorage was not visible in all workspaces
Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java?view=diff&rev=126478&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java&r1=126477&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java&r2=126478
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java	(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java	Tue
Jan 25 23:17:53 2005
@@ -27,6 +27,7 @@
 import org.apache.jackrabbit.core.fs.FileSystemException;
 import org.apache.jackrabbit.core.fs.FileSystemResource;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
+import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
 import org.apache.jackrabbit.core.observation.ObservationManagerFactory;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.PMContext;
@@ -61,6 +62,9 @@
      */
     private static final String ROOT_NODE_UUID = "cafebabe-cafe-babe-cafe-babecafebabe";
 
+    private static final String SYSTEM_ROOT_NODE_UUID = "deadbeef-cafe-babe-cafe-babecafebabe";
+    private static final String VERSION_STORAGE_NODE_UUID = "deadbeef-face-babe-cafe-babecafebabe";
+
     private static final String ANONYMOUS_USER = "anonymous";
 
     private static final Credentials ANONYMOUS_CREDENTIALS =
@@ -308,7 +312,11 @@
          */
         NodeImpl rootNode = (NodeImpl) sysSession.getRootNode();
         if (!rootNode.hasNode(SYSTEM_ROOT_NAME)) {
-            rootNode.addNode(SYSTEM_ROOT_NAME, NodeTypeRegistry.REP_SYSTEM);
+            NodeTypeImpl nt = sysSession.getNodeTypeManager().getNodeType(NodeTypeRegistry.REP_SYSTEM);
+            NodeImpl sysRoot = rootNode.internalAddChildNode(SYSTEM_ROOT_NAME, nt, SYSTEM_ROOT_NODE_UUID);
+            // add version storage
+            nt = sysSession.getNodeTypeManager().getNodeType(NodeTypeRegistry.NT_UNSTRUCTURED);
+            sysRoot.internalAddChildNode(VersionManager.NODENAME_HISTORY_ROOT, nt, VERSION_STORAGE_NODE_UUID);
             rootNode.save();
         }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml?view=diff&rev=126478&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml&r1=126477&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml&r2=126478
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
Tue Jan 25 23:17:53 2005
@@ -291,7 +291,7 @@
         <supertypes>
             <supertype>nt:base</supertype>
         </supertypes>
-        <childNodeDef name="jcr:versionStorage" defaultPrimaryType="nt:unstructured" autoCreate="true"
mandatory="true" onParentVersion="IGNORE" protected="false" primaryItem="false" sameNameSibs="false">
+        <childNodeDef name="jcr:versionStorage" defaultPrimaryType="nt:unstructured" autoCreate="false"
mandatory="true" onParentVersion="IGNORE" protected="false" primaryItem="false" sameNameSibs="false">
             <requiredPrimaryTypes>
                 <requiredPrimaryType>nt:base</requiredPrimaryType>
             </requiredPrimaryTypes>

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?view=diff&rev=126478&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java&r1=126477&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java&r2=126478
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
Tue Jan 25 23:17:53 2005
@@ -82,9 +82,13 @@
                 NodeImpl systemRoot = ((RepositoryImpl) session.getRepository()).getSystemRootNode(session);
                 if (!systemRoot.hasNode(VersionManager.NODENAME_HISTORY_ROOT)) {
                     // if not exist, create
-                    systemRoot.addNode(VersionManager.NODENAME_HISTORY_ROOT, NodeTypeRegistry.NT_UNSTRUCTURED);
+                    //systemRoot.addNode(VersionManager.NODENAME_HISTORY_ROOT, NodeTypeRegistry.NT_UNSTRUCTURED);
+                    //systemRoot.save();
+
+                    // maybe we will create a virtual for every workspace. currently,
+                    // all workspaces share the same
+                    throw new IllegalArgumentException("Workspace has no version storage");
                 }
-                systemRoot.save();
                 String rootId = systemRoot.getNode(VersionManager.NODENAME_HISTORY_ROOT).internalGetUUID();
 
                 NodeState virtRootState = (NodeState) base.getItemState(new NodeId(rootId));

Mime
View raw message