jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r507601 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: SessionImpl.java security/AMContext.java state/SessionItemStateManager.java
Date Wed, 14 Feb 2007 16:19:12 GMT
Author: stefan
Date: Wed Feb 14 08:19:11 2007
New Revision: 507601

URL: http://svn.apache.org/viewvc?view=rev&rev=507601
Log:
JCR-718: NoSuchItemStateException on removing node (no versioning)

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?view=diff&rev=507601&r1=507600&r2=507601
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
Wed Feb 14 08:19:11 2007
@@ -250,7 +250,7 @@
         itemStateMgr = createSessionItemStateManager(wsp.getItemStateManager());
         hierMgr = itemStateMgr.getHierarchyMgr();
         itemMgr = createItemManager(itemStateMgr, hierMgr);
-        accessMgr = createAccessManager(subject, hierMgr);
+        accessMgr = createAccessManager(subject, itemStateMgr.getAtticAwareHierarchyMgr());
         versionMgr = createVersionManager(rep);
     }
 
@@ -314,10 +314,12 @@
             throws AccessDeniedException, RepositoryException {
         AccessManagerConfig amConfig = rep.getConfig().getAccessManagerConfig();
         try {
+
             AMContext ctx = new AMContext(new File(rep.getConfig().getHomeDir()),
                     rep.getFileSystem(),
                     subject,
                     hierMgr,
+                    rep.getNamespaceRegistry(),
                     wsp.getName());
             AccessManager accessMgr = (AccessManager) amConfig.newInstance();
             accessMgr.init(ctx);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java?view=diff&rev=507601&r1=507600&r2=507601
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java
Wed Feb 14 08:19:11 2007
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.core.HierarchyManager;
 import org.apache.jackrabbit.core.fs.FileSystem;
+import org.apache.jackrabbit.name.NamespaceResolver;
 
 import javax.security.auth.Subject;
 import java.io.File;
@@ -51,6 +52,11 @@
     private final HierarchyManager hierMgr;
 
     /**
+     * namespace resolver for resolving namesapces in qualified paths
+     */
+    private final NamespaceResolver nsResolver;
+
+    /**
      * name of the workspace
      */
     private final String workspaceName;
@@ -58,21 +64,24 @@
     /**
      * Creates a new <code>AMContext</code>.
      *
-     * @param homeDir the physical home directory
-     * @param fs      the virtual jackrabbit filesystem
-     * @param subject subject whose access rights should be reflected
-     * @param hierMgr hierarchy manager
-     * @param hierMgr workspace name
+     * @param physicalHomeDir the physical home directory
+     * @param fs              the virtual jackrabbit filesystem
+     * @param subject         subject whose access rights should be reflected
+     * @param hierMgr         hierarchy manager
+     * @param nsResolver      namespace resolver
+     * @param workspaceName   workspace name
      */
-    public AMContext(File homeDir,
+    public AMContext(File physicalHomeDir,
                      FileSystem fs,
                      Subject subject,
                      HierarchyManager hierMgr,
+                     NamespaceResolver nsResolver,
                      String workspaceName) {
-        this.physicalHomeDir = homeDir;
+        this.physicalHomeDir = physicalHomeDir;
         this.fs = fs;
         this.subject = subject;
         this.hierMgr = hierMgr;
+        this.nsResolver = nsResolver;
         this.workspaceName = workspaceName;
     }
 
@@ -111,6 +120,15 @@
      */
     public HierarchyManager getHierarchyManager() {
         return hierMgr;
+    }
+
+    /**
+     * Returns the namespace resolver
+     *
+     * @return the namespace resolver
+     */
+    public NamespaceResolver getNamespaceResolver() {
+        return nsResolver;
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java?view=diff&rev=507601&r1=507600&r2=507601
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
Wed Feb 14 08:19:11 2007
@@ -110,6 +110,17 @@
         return hierMgr;
     }
 
+    /**
+     * Returns an attic-aware hierarchy manager, i.e. an hierarchy manager that
+     * is also able to build/resolve paths of those items that have been moved
+     * or removed (i.e. moved to the attic).
+     *
+     * @return an attic-aware hierarchy manager
+     */
+    public HierarchyManager getAtticAwareHierarchyMgr() {
+        return new ZombieHierarchyManager(hierMgr, this, getAttic());
+    }
+
     //-------------------------------------------------------------< Dumpable >
 
     /**



Mime
View raw message