Return-Path: Delivered-To: apmail-portals-jetspeed-dev-archive@www.apache.org Received: (qmail 15705 invoked from network); 25 Mar 2010 15:07:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Mar 2010 15:07:12 -0000 Received: (qmail 39725 invoked by uid 500); 25 Mar 2010 09:40:31 -0000 Delivered-To: apmail-portals-jetspeed-dev-archive@portals.apache.org Received: (qmail 39703 invoked by uid 500); 25 Mar 2010 09:40:31 -0000 Mailing-List: contact jetspeed-dev-help@portals.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jetspeed Developers List" Delivered-To: mailing list jetspeed-dev@portals.apache.org Received: (qmail 39695 invoked by uid 99); 25 Mar 2010 09:40:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Mar 2010 09:40:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Mar 2010 09:40:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BE5AE238897A; Thu, 25 Mar 2010 09:40:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: jetspeed-dev@portals.apache.org From: rwatler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100325094004.BE5AE238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 --> - PROPAGATION_REQUIRED - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS + PROPAGATION_SUPPORTS + PROPAGATION_SUPPORTS + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_SUPPORTS + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_SUPPORTS,+java.lang.SecurityException + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS 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. - PROPAGATION_REQUIRED - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS + PROPAGATION_SUPPORTS + PROPAGATION_SUPPORTS + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_SUPPORTS + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_SUPPORTS,+java.lang.SecurityException + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS 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 --> - PROPAGATION_REQUIRED - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_SUPPORTS + PROPAGATION_SUPPORTS + PROPAGATION_NOT_SUPPORTED PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS - PROPAGATION_SUPPORTS + PROPAGATION_SUPPORTS + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_SUPPORTS,+java.lang.SecurityException + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_NOT_SUPPORTED + PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException --------------------------------------------------------------------- To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org For additional commands, e-mail: jetspeed-dev-help@portals.apache.org