jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1160757 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel: RepositoryServiceImpl.java util/Paths.java
Date Tue, 23 Aug 2011 15:55:15 GMT
Author: mduerig
Date: Tue Aug 23 15:55:15 2011
New Revision: 1160757

URL: http://svn.apache.org/viewvc?rev=1160757&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
- uuid handling

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1160757&r1=1160756&r2=1160757&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Tue Aug 23 15:55:15 2011
@@ -510,10 +510,10 @@ public class RepositoryServiceImpl exten
         }
 
         if (path == null) {
-            return Paths.parseQPath(itemId.getUniqueID());
+            return Paths.stringToPath(uid);
         }
 
-        return PathFactoryImpl.getInstance().create(Paths.parseQPath(itemId.getUniqueID()),
path, true);
+        return PathFactoryImpl.getInstance().create(Paths.stringToPath(uid), path, true);
     }
 
     private static SubscriptionImpl subscription(Subscription subscription) throws RepositoryException
{
@@ -635,6 +635,12 @@ public class RepositoryServiceImpl exten
 
                 DefaultValueProvider defaultProvider = Values.getDefaultProvider(nodetypeName,
nodeTypeDefs);
                 for (Name propertyName : defaultProvider.getDefaultProperties()) {
+                    if (uuid == null) {
+                        // todo: make uuid more stable
+                        String parentPath = Paths.pathToString(getPath(parentId));
+                        String name = Paths.nameToString(nodeName);
+                        uuid = PathUtils.concat(parentPath, name);
+                    }
                     QValue value = defaultProvider.getValue(propertyName, sessionInfo, uuid);
                     setProperty(target(parentId, nodeName, propertyName), Values.valueToString(value,
saveToDataStore));
                 }
@@ -701,7 +707,9 @@ public class RepositoryServiceImpl exten
             for (Name mixin: mixinNodeTypeNames) {
                 DefaultValueProvider defaultProvider = Values.getDefaultProvider(mixin, nodeTypeDefs);
                 for (Name propertyName : defaultProvider.getDefaultProperties()) {
-                    QValue value = defaultProvider.getValue(propertyName, sessionInfo, getPath(nodeId).toString());
+                    // todo: make uuid more stable
+                    String uuid = Paths.pathToString(getPath(nodeId));
+                    QValue value = defaultProvider.getValue(propertyName, sessionInfo, uuid);
                     setProperty(nodeId, propertyName, Values.valueToString(value, saveToDataStore));
                 }
             }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java?rev=1160757&r1=1160756&r2=1160757&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java
Tue Aug 23 15:55:15 2011
@@ -81,10 +81,6 @@ public final class Paths {
         return PATH_FACTORY.create(elements.toArray(new Element[elements.size()]));
     }
 
-    public static Path parseQPath(String qPath) {
-        return PATH_FACTORY.create(qPath);
-    }
-
     public static String nameToString(Name name) {
         String nameSpaceURI = name.getNamespaceURI();
         return '{' + escapeNameSpaceURI(nameSpaceURI) + '}' + name.getLocalName();



Mime
View raw message