jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r149266 - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: NodeImpl.java nodetype/NodeTypeImpl.java nodetype/builtin_nodetypes.xml version/VersionHistoryImpl.java
Date Mon, 31 Jan 2005 14:54:10 GMT
Author: tripod
Date: Mon Jan 31 06:54:08 2005
New Revision: 149266

URL: http://svn.apache.org/viewcvs?view=rev&rev=149266
Log:
- some minor fixes

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?view=diff&r1=149265&r2=149266
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Mon Jan 31
06:54:08 2005
@@ -2398,7 +2398,7 @@
         if (hasProperty(name)) {
             return getProperty(name);
         } else if (hasNode(name)) {
-            return getProperty(name);
+            return getNode(name);
         } else {
             throw new ItemNotFoundException();
         }
@@ -3138,8 +3138,8 @@
                 checkUUIDCollisions((InternalFrozenNode) fs[i], removeExisting);
             } else if (!removeExisting) {
                 InternalFrozenVersionHistory fh = (InternalFrozenVersionHistory) fs[i];
-                VersionHistory history = (VersionHistory) session.getNodeByUUID(fh.getVersionHistoryId());
-                String nodeId = history.getName(); // this is implementation detail!
+                VersionHistoryImpl history = (VersionHistoryImpl) session.getNodeByUUID(fh.getVersionHistoryId());
+                String nodeId = history.getVersionedUUID();
 
                 // check if representing vh already exists somewhere
                 if (itemMgr.itemExists(new NodeId(nodeId))) {
@@ -3300,8 +3300,8 @@
                 n.restoreFrozenState(f, vsel, removeExisting);
             } else if (child instanceof InternalFrozenVersionHistory) {
                 InternalFrozenVersionHistory f = (InternalFrozenVersionHistory) child;
-                VersionHistory history = (VersionHistory) session.getNodeByUUID(f.getVersionHistoryId());
-                String nodeId = history.getName(); // this is implementation detail!
+                VersionHistoryImpl history = (VersionHistoryImpl) session.getNodeByUUID(f.getVersionHistoryId());
+                String nodeId = history.getVersionedUUID();
 
                 // check if representing vh already exists somewhere
                 if (itemMgr.itemExists(new NodeId(nodeId))) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java?view=diff&r1=149265&r2=149266
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
Mon Jan 31 06:54:08 2005
@@ -293,7 +293,8 @@
      */
     public String getPrimaryItemName() {
         try {
-            return ntd.getPrimaryItemName().toJCRName(nsResolver);
+            QName piName = ntd.getPrimaryItemName();
+            return piName == null ? null : piName.toJCRName(nsResolver);
         } catch (NoPrefixDeclaredException npde) {
             // should never get here
             log.error("encountered unregistered namespace in name of primary item", npde);

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&r1=149265&r2=149266
==============================================================================
--- 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
Mon Jan 31 06:54:08 2005
@@ -97,7 +97,7 @@
             </requiredPrimaryTypes>
         </childNodeDef>
     </nodeType>
-    <nodeType name="nt:resource" mixin="false" orderableChildNodes="false" primaryItemName="">
+    <nodeType name="nt:resource" mixin="false" orderableChildNodes="false" primaryItemName="jcr:data">
         <supertypes>
             <supertype>nt:base</supertype>
             <supertype>mix:referenceable</supertype>
@@ -125,6 +125,7 @@
         <propertyDef name="jcr:supertypes" type="Name" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="true"/>
         <propertyDef name="jcr:isMixin" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDef name="jcr:orderableChildNodes" type="Boolean" autoCreate="false"
mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
+        <propertyDef name="jcr:primaryItemName" type="String" autoCreate="false" mandatory="false"
onParentVersion="COPY" protected="false" multiple="false"/>
         <childNodeDef name="jcr:propertyDef" defaultPrimaryType="nt:propertyDef" autoCreate="false"
mandatory="false" onParentVersion="VERSION" protected="false" sameNameSibs="true">
             <requiredPrimaryTypes>
                 <requiredPrimaryType>nt:propertyDef</requiredPrimaryType>
@@ -148,7 +149,6 @@
         <propertyDef name="jcr:mandatory" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDef name="jcr:onParentVersion" type="String" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDef name="jcr:protected" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
-        <propertyDef name="jcr:primaryItem" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDef name="jcr:multiple" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
     </nodeType>
     <nodeType name="nt:childNodeDef" mixin="false" orderableChildNodes="false" primaryItemName="">
@@ -166,7 +166,6 @@
         <propertyDef name="jcr:mandatory" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDef name="jcr:onParentVersion" type="String" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDef name="jcr:protected" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
-        <propertyDef name="jcr:primaryItem" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDef name="jcr:sameNameSibs" type="Boolean" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>
     </nodeType>
     <nodeType name="nt:versionHistory" mixin="false" orderableChildNodes="false" primaryItemName="">

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java?view=diff&r1=149265&r2=149266
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
Mon Jan 31 06:54:08 2005
@@ -163,6 +163,7 @@
      */
     public String getUUID()
             throws UnsupportedRepositoryOperationException, RepositoryException {
+        //history.getRootVersion().getFrozenNode().getFrozenUUID();
         return history.getId();
     }
 
@@ -176,5 +177,13 @@
         } else {
             return false;
         }
+    }
+
+    /**
+     * Returns the UUID of the node that was versioned.
+     * @return
+     */
+    public String getVersionedUUID() throws RepositoryException {
+        return getName();
     }
 }



Mime
View raw message