portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r927318 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-manager/src/test/resources/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/ etc/import/assembly/ jetspeed-portal-resources/src/main/resourc...
Date Thu, 25 Mar 2010 09:40:04 GMT
Author: rwatler
Date: Thu Mar 25 09:40:04 2010
New Revision: 927318

URL: http://svn.apache.org/viewvc?rev=927318&view=rev
Log:
correct transaction processing for portal administration registration and DB page manager
proxy SecurityException propagation

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
    portals/jetspeed-2/portal/trunk/etc/import/assembly/import-page-manager.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml?rev=927318&r1=927317&r2=927318&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml
Thu Mar 25 09:40:04 2010
@@ -119,35 +119,27 @@ limitations under the License.
                   for methods that directly or indirectly add cache transactions so that
                   they can properly rollback and cleanup thread local storage
               -->
-              <prop key="*">PROPAGATION_REQUIRED</prop>
-              <prop key="getPage*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getPageTemplate*">PROPAGATION_SUPPORTS</prop>
-              <prop key="getDynamicPage*">PROPAGATION_SUPPORTS</prop>
-              <prop key="getFragmentDefinition*">PROPAGATION_SUPPORTS</prop>
-              <prop key="getLink*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getFolder*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getContentPage">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getAll">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getUserFolder">PROPAGATION_SUPPORTS</prop>  
+              <prop key="*">PROPAGATION_SUPPORTS</prop>
+              <prop key="*Exists">PROPAGATION_SUPPORTS</prop>
+              <prop key="addListener">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="checkConstraint">PROPAGATION_SUPPORTS</prop>
+              <prop key="cleanupRequestCache">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="copy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="deep*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="get*">PROPAGATION_SUPPORTS,+java.lang.SecurityException</prop>
+              <prop key="getConstraintsEnabled">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="getNodeReapingInterval">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="getPermissionsEnabled">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="isDistributed">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="new*">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="notifyUpdatedNode">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="removeListener">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="reset">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="shutdown">PROPAGATION_NOT_SUPPORTED</prop>
               <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePageTemplate">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeDynamicPage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeFragmentDefinition">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeFolder">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeLink">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePageSecurity">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
                           
-              <prop key="createUserHomePagesFromRoles">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
             
-              <prop key="folderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="pageExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="pageTemplateExists">PROPAGATION_SUPPORTS</prop>
-              <prop key="dynamicPageExists">PROPAGATION_SUPPORTS</prop>
-              <prop key="fragmentDefinitionExists">PROPAGATION_SUPPORTS</prop>
-              <prop key="linkExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userFolderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userPageExists">PROPAGATION_SUPPORTS</prop>  
             </props>
         </property>
         <property name="preInterceptors"> 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java?rev=927318&r1=927317&r2=927318&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
Thu Mar 25 09:40:04 2010
@@ -299,8 +299,7 @@ public class PortalAdministrationImpl im
             String userFolderPath = null;
             if ((subsite == null) && (serverName != null))
             {
-                PortalSiteRequestContext requestContext = getMockPortalSiteRequestContext(user,
locale, serverName);
-                userFolderPath = requestContext.getUserFolderPath();
+                userFolderPath = invokeGetUserFolderPath(user, locale, serverName);
             }
             else if (subsite != null)
             {
@@ -581,8 +580,7 @@ public class PortalAdministrationImpl im
         try
         {
             User user = userManager.getUser(userName);
-            PortalSiteRequestContext requestContext = getMockPortalSiteRequestContext(user,
locale, serverName);
-            return requestContext.getUserFolderPath();
+            return invokeGetUserFolderPath(user, locale, serverName);
         }
         catch (Exception e)
         {
@@ -599,8 +597,7 @@ public class PortalAdministrationImpl im
         try
         {
             User user = userManager.getUser(userName);
-            PortalSiteRequestContext requestContext = getMockPortalSiteRequestContext(user,
locale, serverName);
-            return requestContext.getBaseFolderPath();
+            return invokeGetBaseFolderPath(user, locale, serverName);
         }
         catch (Exception e)
         {
@@ -608,11 +605,88 @@ public class PortalAdministrationImpl im
             return null;
         }
     }
+
+    /**
+     * Returns PSML user folder path for specified user by
+     * running full profiler and portal site rules within a
+     * JSSubject.doAsPrivileged() block with a subject matching
+     * the specified user.
+     * 
+     * @param user existing portal user
+     * @param locale optional locale, (defaults to system locale, for language
+     *               profiling rules)
+     * @param serverName server name, (required for subsite profiling rules)
+     * @return PSML user folder path
+     * @throws Exception
+     */
+    private String invokeGetUserFolderPath(final User user, final Locale locale, final String
serverName) throws Exception
+    {
+        Object doneAs = JSSubject.doAsPrivileged(userManager.getSubject(user), new PrivilegedAction()
+        {
+            public Object run() 
+            {
+                try
+                {
+                    PortalSiteRequestContext requestContext = getMockPortalSiteRequestContext(user,
locale, serverName);
+                    return requestContext.getUserFolderPath();
+                }
+                catch (Exception e)
+                {
+                    return e;
+                }
+            }
+        }, null);
+        if (doneAs instanceof Exception)
+        {
+            throw (Exception)doneAs;
+        }
+        return (String)doneAs;
+    }
+    
+    /**
+     * Returns PSML base folder path for specified user by
+     * running full profiler and portal site rules within a
+     * JSSubject.doAsPrivileged() block with a subject matching
+     * the specified user.
+     * 
+     * @param user existing portal user
+     * @param locale optional locale, (defaults to system locale, for language
+     *               profiling rules)
+     * @param serverName server name, (required for subsite profiling rules)
+     * @return PSML base folder path
+     * @throws Exception
+     */
+    private String invokeGetBaseFolderPath(final User user, final Locale locale, final String
serverName) throws Exception
+    {
+        Object doneAs = JSSubject.doAsPrivileged(userManager.getSubject(user), new PrivilegedAction()
+        {
+            public Object run() 
+            {
+                try
+                {
+                    PortalSiteRequestContext requestContext = getMockPortalSiteRequestContext(user,
locale, serverName);
+                    return requestContext.getBaseFolderPath();
+                }
+                catch (Exception e)
+                {
+                    return e;
+                }
+            }
+        }, null);
+        if (doneAs instanceof Exception)
+        {
+            throw (Exception)doneAs;
+        }
+        return (String)doneAs;
+    }
     
     /**
      * Returns temporary mock portal site request context for
      * specified user for use in constructing user or base PSML
-     * folder paths or accessing other profiled site data.
+     * folder paths or accessing other profiled site data. This
+     * method invocation should be wrapped in a
+     * JSSubject.doAsPrivileged() block with a subject matching
+     * the specified user.
      * 
      * @param user portal user
      * @param locale optional locale, (defaults to system locale, for language
@@ -651,5 +725,5 @@ public class PortalAdministrationImpl im
         // component using the profile locators for new user request
         PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
         return sessionContext.newRequestContext(locators, user.getName());
-    }
+    }    
 }

Modified: portals/jetspeed-2/portal/trunk/etc/import/assembly/import-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/etc/import/assembly/import-page-manager.xml?rev=927318&r1=927317&r2=927318&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/etc/import/assembly/import-page-manager.xml (original)
+++ portals/jetspeed-2/portal/trunk/etc/import/assembly/import-page-manager.xml Thu Mar 25
09:40:04 2010
@@ -55,35 +55,27 @@ limitations under the License.
         </property>
         <property name="transactionAttributes">
             <props>
-              <prop key="*">PROPAGATION_REQUIRED</prop>
-              <prop key="getPage*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getPageTemplate*">PROPAGATION_SUPPORTS</prop>
-              <prop key="getDynamicPage*">PROPAGATION_SUPPORTS</prop>
-              <prop key="getFragmentDefinition*">PROPAGATION_SUPPORTS</prop>
-              <prop key="getLink*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getFolder*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getContentPage">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getAll">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getUserFolder">PROPAGATION_SUPPORTS</prop>  
+              <prop key="*">PROPAGATION_SUPPORTS</prop>
+              <prop key="*Exists">PROPAGATION_SUPPORTS</prop>
+              <prop key="addListener">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="checkConstraint">PROPAGATION_SUPPORTS</prop>
+              <prop key="cleanupRequestCache">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="copy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="deep*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="get*">PROPAGATION_SUPPORTS,+java.lang.SecurityException</prop>
+              <prop key="getConstraintsEnabled">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="getNodeReapingInterval">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="getPermissionsEnabled">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="isDistributed">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="new*">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="notifyUpdatedNode">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="removeListener">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="reset">PROPAGATION_NOT_SUPPORTED</prop>
+              <prop key="shutdown">PROPAGATION_NOT_SUPPORTED</prop>
               <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePageTemplate">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeDynamicPage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeFragmentDefinition">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeFolder">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeLink">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePageSecurity">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
                           
-              <prop key="createUserHomePagesFromRoles">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
             
-              <prop key="folderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="pageExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="pageTemplateExists">PROPAGATION_SUPPORTS</prop>
-              <prop key="dynamicPageExists">PROPAGATION_SUPPORTS</prop>
-              <prop key="fragmentDefinitionExists">PROPAGATION_SUPPORTS</prop>
-              <prop key="linkExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userFolderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userPageExists">PROPAGATION_SUPPORTS</prop>  
             </props>
         </property>
     </bean>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml?rev=927318&r1=927317&r2=927318&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
Thu Mar 25 09:40:04 2010
@@ -289,35 +289,27 @@
           for methods that directly or indirectly add cache transactions so that
           they can properly rollback and cleanup thread local storage
         -->
-        <prop key="*">PROPAGATION_REQUIRED</prop>
-        <prop key="getPage*">PROPAGATION_SUPPORTS</prop>
-        <prop key="getPageTemplate*">PROPAGATION_SUPPORTS</prop>
-        <prop key="getDynamicPage*">PROPAGATION_SUPPORTS</prop>
-        <prop key="getFragmentDefinition*">PROPAGATION_SUPPORTS</prop>
-        <prop key="getLink*">PROPAGATION_SUPPORTS</prop>
-        <prop key="getFolder*">PROPAGATION_SUPPORTS</prop>
-        <prop key="getContentPage">PROPAGATION_SUPPORTS</prop>
-        <prop key="getAll">PROPAGATION_SUPPORTS</prop>
-        <prop key="getUserFolder">PROPAGATION_SUPPORTS</prop>
-        <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="removePage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="removePageTemplate">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="removeDynamicPage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="removeFragmentDefinition">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="removeFolder">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="removeLink">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="removePageSecurity">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="createUserHomePagesFromRoles">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+        <prop key="*">PROPAGATION_SUPPORTS</prop>
+        <prop key="*Exists">PROPAGATION_SUPPORTS</prop>
+        <prop key="addListener">PROPAGATION_NOT_SUPPORTED</prop>
         <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-        <prop key="folderExists">PROPAGATION_SUPPORTS</prop>
-        <prop key="pageExists">PROPAGATION_SUPPORTS</prop>
-        <prop key="pageTemplateExists">PROPAGATION_SUPPORTS</prop>
-        <prop key="dynamicPageExists">PROPAGATION_SUPPORTS</prop>
-        <prop key="fragmentDefinitionExists">PROPAGATION_SUPPORTS</prop>
-        <prop key="linkExists">PROPAGATION_SUPPORTS</prop>
-        <prop key="userFolderExists">PROPAGATION_SUPPORTS</prop>
-        <prop key="userPageExists">PROPAGATION_SUPPORTS</prop>
+        <prop key="checkConstraint">PROPAGATION_SUPPORTS</prop>
+        <prop key="cleanupRequestCache">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="copy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+        <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+        <prop key="deep*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+        <prop key="get*">PROPAGATION_SUPPORTS,+java.lang.SecurityException</prop>
+        <prop key="getConstraintsEnabled">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="getNodeReapingInterval">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="getPermissionsEnabled">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="isDistributed">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="new*">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="notifyUpdatedNode">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+        <prop key="removeListener">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="reset">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="shutdown">PROPAGATION_NOT_SUPPORTED</prop>
+        <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
       </props>
     </property>
     <property name="preInterceptors">



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message