jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1456036 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: ./ query/ version/ xml/
Date Wed, 13 Mar 2013 16:29:46 GMT
Author: mduerig
Date: Wed Mar 13 16:29:46 2013
New Revision: 1456036

URL: http://svn.apache.org/r1456036
Log:
OAK-672: Avoid JCR APIs calling other JCR APIs
- SessionContext implements NamePathMapper

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Wed Mar 13 16:29:46 2013
@@ -31,7 +31,6 @@ import org.apache.jackrabbit.commons.Abs
 import org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate;
 import org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate;
 import org.apache.jackrabbit.oak.jcr.delegate.SessionOperation;
-import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.plugins.nodetype.DefinitionProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -253,7 +252,6 @@ abstract class ItemImpl<T extends ItemDe
 
     @Nonnull
     String toJcrPath(String oakPath) {
-        NamePathMapper namePathMapper = sessionContext.getNamePathMapper();
-        return namePathMapper.getJcrPath(oakPath);
+        return sessionContext.getJcrPath(oakPath);
     }
 }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Wed Mar 13 16:29:46 2013
@@ -227,7 +227,7 @@ public class NodeImpl<T extends NodeDele
     }
 
     private String getOakPath(String jcrPath) throws RepositoryException {
-        return sessionContext.getOakPath(jcrPath);
+        return sessionContext.getOakPathOrThrow(jcrPath);
     }
 
     @Override
@@ -998,7 +998,7 @@ public class NodeImpl<T extends NodeDele
                             JcrConstants.JCR_MIXINTYPES, Collections.singletonList(value)));
                 } else {
                     PropertyState property = mixins.getMultiState();
-                    List<Value> values = ValueFactoryImpl.createValues(property, sessionContext.getNamePathMapper());
+                    List<Value> values = ValueFactoryImpl.createValues(property, sessionContext);
                     if (!values.contains(value)) {
                         values.add(value);
                         nodeModified = true;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
Wed Mar 13 16:29:46 2013
@@ -366,7 +366,7 @@ public class PropertyImpl extends ItemIm
 
             @Override
             public Value perform() throws RepositoryException {
-                return ValueFactoryImpl.createValue(dlg.getSingleState(), sessionContext.getNamePathMapper());
+                return ValueFactoryImpl.createValue(dlg.getSingleState(), sessionContext);
             }
         });
     }
@@ -382,7 +382,7 @@ public class PropertyImpl extends ItemIm
 
             @Override
             public List<Value> perform() throws RepositoryException {
-                return ValueFactoryImpl.createValues(dlg.getMultiState(), sessionContext.getNamePathMapper());
+                return ValueFactoryImpl.createValues(dlg.getMultiState(), sessionContext);
             }
         }).toArray(NO_VALUES);
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
Wed Mar 13 16:29:46 2013
@@ -38,7 +38,7 @@ import org.apache.jackrabbit.oak.spi.sec
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
-public abstract class SessionContext {
+public abstract class SessionContext implements NamePathMapper {
     private final RepositoryImpl repository;
     private final SessionDelegate delegate;
     private final NamePathMapper namePathMapper;
@@ -130,104 +130,10 @@ public abstract class SessionContext {
         return getWorkspaceInternal().getReadWriteNodeTypeManager();
     }
 
-    public NamePathMapper getNamePathMapper() {
-        return namePathMapper;
-    }
-
     public ValueFactory getValueFactory() {
         return valueFactory;
     }
 
-    /**
-     * Returns the Oak name for the given JCR name, or throws a
-     * {@link javax.jcr.RepositoryException} if the name is invalid or can
-     * otherwise not be mapped.
-     *
-     * @param jcrName JCR name
-     * @return Oak name
-     * @throws javax.jcr.RepositoryException if the name is invalid
-     */
-    @Nonnull
-    public String getOakName(String jcrName) throws RepositoryException {
-        return namePathMapper.getOakName(jcrName);
-    }
-
-    /**
-     * Returns the Oak path for the given JCR path, or throws a
-     * {@link javax.jcr.RepositoryException} if the path can not be mapped.
-     *
-     * @param jcrPath JCR path
-     * @return Oak path
-     * @throws javax.jcr.RepositoryException if the path can not be mapped
-     */
-    @Nonnull
-    public String getOakPath(String jcrPath) throws RepositoryException {
-        String oakPath = getOakPathOrNull(jcrPath);
-        if (oakPath != null) {
-            return oakPath;
-        } else {
-            throw new RepositoryException("Invalid name or path: " + jcrPath);
-        }
-    }
-
-    /**
-     * Shortcut for {@code SessionDelegate.getNamePathMapper().getOakPath(jcrPath)}.
-     *
-     * @param jcrPath JCR path
-     * @return Oak path, or {@code null}
-     */
-    @CheckForNull
-    public String getOakPathOrNull(String jcrPath) {
-        return namePathMapper.getOakPath(jcrPath);
-    }
-
-    /**
-     * Returns the Oak path for the given JCR path, or throws a
-     * {@link javax.jcr.PathNotFoundException} if the path can not be mapped.
-     *
-     * @param jcrPath JCR path
-     * @return Oak path
-     * @throws javax.jcr.PathNotFoundException if the path can not be mapped
-     */
-    @Nonnull
-    public String getOakPathOrThrowNotFound(String jcrPath) throws PathNotFoundException
{
-        String oakPath = getOakPathOrNull(jcrPath);
-        if (oakPath != null) {
-            return oakPath;
-        } else {
-            throw new PathNotFoundException(jcrPath);
-        }
-    }
-
-    /**
-     * Shortcut for {@code SessionDelegate.getOakPathKeepIndex(jcrPath)}.
-     *
-     * @param jcrPath JCR path
-     * @return Oak path, or {@code null}, with indexes left intact
-     * @throws javax.jcr.PathNotFoundException
-     */
-    @CheckForNull
-    public String getOakPathKeepIndex(String jcrPath) throws PathNotFoundException {
-        return namePathMapper.getOakPathKeepIndex(jcrPath);
-    }
-
-    /**
-     * Shortcut for {@code SessionDelegate.getOakPathKeepIndex(jcrPath)}.
-     *
-     * @param jcrPath JCR path
-     * @return Oak path, or {@code null}, with indexes left intact
-     * @throws javax.jcr.PathNotFoundException
-     */
-    @Nonnull
-    public String getOakPathKeepIndexOrThrowNotFound(String jcrPath) throws PathNotFoundException
{
-        String oakPath = namePathMapper.getOakPathKeepIndex(jcrPath);
-        if (oakPath != null) {
-            return oakPath;
-        } else {
-            throw new PathNotFoundException(jcrPath);
-        }
-    }
-
     @Nonnull
     public AccessControlManager getAccessControlManager(SessionDelegate delegate) {
         if (accessControlManager == null) {
@@ -306,6 +212,101 @@ public abstract class SessionContext {
         return observationManager != null && observationManager.hasEvents();
     }
 
+    //------------------------------------------------------------< NamePathMapper >---
+
+    @Override
+    @Nonnull
+    public String getOakName(String jcrName) throws RepositoryException {
+        return namePathMapper.getOakName(jcrName);
+    }
+
+    @Override
+    @CheckForNull
+    public String getOakNameOrNull(@Nonnull String jcrName) {
+        return namePathMapper.getOakNameOrNull(jcrName);
+    }
+
+    @Override
+    public boolean hasSessionLocalMappings() {
+        return namePathMapper.hasSessionLocalMappings();
+    }
+
+    @Override
+    public String getJcrName(@Nonnull String oakName) {
+        return namePathMapper.getJcrName(oakName);
+    }
+
+    @Override
+    @CheckForNull
+    public String getOakPath(String jcrPath) {
+        return namePathMapper.getOakPath(jcrPath);
+    }
+
+    @Override
+    @CheckForNull
+    public String getOakPathKeepIndex(String jcrPath) {
+        return namePathMapper.getOakPathKeepIndex(jcrPath);
+    }
+
+    @Override
+    @Nonnull
+    public String getJcrPath(String oakPath) {
+        return namePathMapper.getJcrPath(oakPath);
+    }
+
+    /**
+     * Returns the Oak path for the given JCR path, or throws a
+     * {@link javax.jcr.RepositoryException} if the path can not be mapped.
+     *
+     * @param jcrPath JCR path
+     * @return Oak path
+     * @throws javax.jcr.RepositoryException if the path can not be mapped
+     */
+    @Nonnull
+    public String getOakPathOrThrow(String jcrPath) throws RepositoryException {
+        String oakPath = getOakPath(jcrPath);
+        if (oakPath != null) {
+            return oakPath;
+        } else {
+            throw new RepositoryException("Invalid name or path: " + jcrPath);
+        }
+    }
+
+    /**
+     * Returns the Oak path for the given JCR path, or throws a
+     * {@link javax.jcr.PathNotFoundException} if the path can not be mapped.
+     *
+     * @param jcrPath JCR path
+     * @return Oak path
+     * @throws javax.jcr.PathNotFoundException if the path can not be mapped
+     */
+    @Nonnull
+    public String getOakPathOrThrowNotFound(String jcrPath) throws PathNotFoundException
{
+        String oakPath = getOakPath(jcrPath);
+        if (oakPath != null) {
+            return oakPath;
+        } else {
+            throw new PathNotFoundException(jcrPath);
+        }
+    }
+
+    /**
+     * Shortcut for {@code SessionDelegate.getOakPathKeepIndex(jcrPath)}.
+     *
+     * @param jcrPath JCR path
+     * @return Oak path, or {@code null}, with indexes left intact
+     * @throws javax.jcr.PathNotFoundException
+     */
+    @Nonnull
+    public String getOakPathKeepIndexOrThrowNotFound(String jcrPath) throws PathNotFoundException
{
+        String oakPath = namePathMapper.getOakPathKeepIndex(jcrPath);
+        if (oakPath != null) {
+            return oakPath;
+        } else {
+            throw new PathNotFoundException(jcrPath);
+        }
+    }
+
     //------------------------------------------------------------< internal >---
 
     void dispose() {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Wed Mar 13 16:29:46 2013
@@ -207,7 +207,7 @@ public class SessionImpl extends Abstrac
     }
 
     private String getOakPath(String absPath) throws RepositoryException {
-        return sessionContext.getOakPath(absPath);
+        return sessionContext.getOakPathOrThrow(absPath);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Wed Mar 13 16:29:46 2013
@@ -95,7 +95,7 @@ public class WorkspaceImpl implements Ja
             @Nonnull
             @Override
             protected NamePathMapper getNamePathMapper() {
-                return sessionContext.getNamePathMapper();
+                return sessionContext;
             }
         };
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java
Wed Mar 13 16:29:46 2013
@@ -134,7 +134,7 @@ public class QueryImpl implements Query 
     @Override
     public Node storeAsNode(String absPath) throws RepositoryException {
         manager.ensureIsAlive();
-        String oakPath = sessionContext.getOakPath(absPath);
+        String oakPath = sessionContext.getOakPathOrThrow(absPath);
         String parent = PathUtils.getParentPath(oakPath);
         NodeDelegate parentDelegate = sessionContext.getSessionDelegate().getNode(parent);
         if (parentDelegate == null) {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
Wed Mar 13 16:29:46 2013
@@ -42,7 +42,6 @@ import org.apache.jackrabbit.oak.api.Res
 import org.apache.jackrabbit.oak.jcr.SessionContext;
 import org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate;
 import org.apache.jackrabbit.oak.jcr.query.qom.QueryObjectModelFactoryImpl;
-import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
 
@@ -119,9 +118,8 @@ public class QueryManagerImpl implements
             long limit, long offset, HashMap<String, Value> bindVariableMap) throws
RepositoryException {
         try {
             Map<String, PropertyValue> bindMap = convertMap(bindVariableMap);
-            NamePathMapper namePathMapper = sessionContext.getNamePathMapper();
             Result r = queryEngine.executeQuery(statement, language, limit, offset,
-                    bindMap, namePathMapper);
+                    bindMap, sessionContext);
             return new QueryResultImpl(sessionContext, r);
         } catch (IllegalArgumentException e) {
             throw new InvalidQueryException(e);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
Wed Mar 13 16:29:46 2013
@@ -241,7 +241,7 @@ public class QueryResultImpl implements 
         if (value == null) {
             return null;
         } else {
-            return ValueFactoryImpl.createValue(value, sessionContext.getNamePathMapper());
+            return ValueFactoryImpl.createValue(value, sessionContext);
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionHistoryImpl.java
Wed Mar 13 16:29:46 2013
@@ -39,7 +39,6 @@ import org.apache.jackrabbit.oak.jcr.Nod
 import org.apache.jackrabbit.oak.jcr.SessionContext;
 import org.apache.jackrabbit.oak.jcr.delegate.VersionDelegate;
 import org.apache.jackrabbit.oak.jcr.delegate.VersionHistoryDelegate;
-import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.util.TODO;
 
 /**
@@ -134,10 +133,9 @@ public class VersionHistoryImpl extends 
 
     @Override
     public String[] getVersionLabels() throws RepositoryException {
-        NamePathMapper mapper = sessionContext.getNamePathMapper();
         List<String> labels = new ArrayList<String>();
         for (String label : dlg.getVersionLabels()) {
-            labels.add(mapper.getJcrName(label));
+            labels.add(sessionContext.getJcrName(label));
         }
         return labels.toArray(new String[labels.size()]);
     }
@@ -149,10 +147,9 @@ public class VersionHistoryImpl extends 
             throw new VersionException("Version is not contained in this " +
                     "VersionHistory");
         }
-        NamePathMapper mapper = sessionContext.getNamePathMapper();
         List<String> labels = new ArrayList<String>();
         for (String label : dlg.getVersionLabels(version.getIdentifier())) {
-            labels.add(mapper.getJcrName(label));
+            labels.add(sessionContext.getJcrName(label));
         }
         return labels.toArray(new String[labels.size()]);
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/VersionImpl.java
Wed Mar 13 16:29:46 2013
@@ -57,7 +57,7 @@ class VersionImpl extends NodeImpl<Versi
     @Override
     public Calendar getCreated() throws RepositoryException {
         PropertyDelegate dlg = getPropertyOrThrow(JcrConstants.JCR_CREATED);
-        return ValueFactoryImpl.createValue(dlg.getSingleState(), sessionContext.getNamePathMapper()).getDate();
+        return ValueFactoryImpl.createValue(dlg.getSingleState(), sessionContext).getDate();
     }
 
     @Override
@@ -71,7 +71,7 @@ class VersionImpl extends NodeImpl<Versi
     }
 
     private List<Value> getValues(PropertyDelegate p) throws InvalidItemStateException,
ValueFormatException {
-        return ValueFactoryImpl.createValues(p.getMultiState(), sessionContext.getNamePathMapper());
+        return ValueFactoryImpl.createValues(p.getMultiState(), sessionContext);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java?rev=1456036&r1=1456035&r2=1456036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java
Wed Mar 13 16:29:46 2013
@@ -41,7 +41,6 @@ import org.apache.jackrabbit.JcrConstant
 import org.apache.jackrabbit.commons.NamespaceHelper;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.jcr.SessionContext;
-import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.plugins.nodetype.EffectiveNodeTypeProvider;
 import org.apache.jackrabbit.oak.spi.security.authorization.AccessControlConfiguration;
 import org.apache.jackrabbit.oak.spi.security.user.UserConfiguration;
@@ -104,15 +103,14 @@ public class SessionImporter implements 
 
         //TODO clarify how to provide ProtectedItemImporters
         UserConfiguration userConfig = sessionContext.getUserConfiguration();
-        NamePathMapper namePathMapper = sessionContext.getNamePathMapper();
         for (ProtectedItemImporter importer : userConfig.getProtectedItemImporters()) {
-            if (importer.init(session, root, namePathMapper, false, uuidBehavior, refTracker))
{
+            if (importer.init(session, root, sessionContext, false, uuidBehavior, refTracker))
{
                 pItemImporters.add(importer);
             }
         }
         AccessControlConfiguration accessControlConfig = sessionContext.getAccessControlConfiguration();
         for (ProtectedItemImporter importer : accessControlConfig.getProtectedItemImporters())
{
-            if (importer.init(session, root, namePathMapper, false, uuidBehavior, refTracker))
{
+            if (importer.init(session, root, sessionContext, false, uuidBehavior, refTracker))
{
                 pItemImporters.add(importer);
             }
         }



Mime
View raw message