You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ed...@apache.org on 2010/05/14 02:38:15 UTC

svn commit: r944069 - in /portals/pluto/trunk: pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/ pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ pluto-portal-driver/src/main/java/o...

Author: edalquist
Date: Fri May 14 00:38:15 2010
New Revision: 944069

URL: http://svn.apache.org/viewvc?rev=944069&view=rev
Log:
PLUTO-590 Don't trim leading /'s from portlet application names as this will break for a portlet application deployed to the root servlet context.

Modified:
    portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java
    portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
    portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java

Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java?rev=944069&r1=944068&r2=944069&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventCoordinationServiceImpl.java Fri May 14 00:38:15 2010
@@ -125,10 +125,6 @@ public class EventCoordinationServiceImp
 		for (PortletWindowConfig portlet : portlets) {
 			String contextPath = portlet.getContextPath();
             String applicationName = contextPath;
-            if (applicationName.length() >0 )
-            {
-                applicationName = applicationName.substring(1);
-            }
 			PortletApplicationDefinition portletAppDD = null;
 			try {
 				portletAppDD = portletRegistry.getPortletApplication(applicationName);

Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java?rev=944069&r1=944068&r2=944069&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java Fri May 14 00:38:15 2010
@@ -102,10 +102,6 @@ public class SupportedModesServiceImpl i
     {
         String applicationId = PortletWindowConfig.parseContextPath(portletId);
         String applicationName = applicationId;
-        if (applicationName.length() > 0)
-        {
-            applicationName = applicationName.substring(1);
-        }
         String portletName = PortletWindowConfig.parsePortletName(portletId);
 
         try
@@ -177,10 +173,10 @@ public class SupportedModesServiceImpl i
     {
         String applicationId = PortletWindowConfig.parseContextPath(portletId);
         String applicationName = applicationId;
-        if (applicationName.length() > 0)
-        {
-            applicationName = applicationName.substring(1);
-        }
+//        if (applicationName.length() > 0)
+//        {
+//            applicationName = applicationName.substring(1);
+//        }
         try
         {
             PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName);
@@ -217,10 +213,10 @@ public class SupportedModesServiceImpl i
 
         String applicationId = PortletWindowConfig.parseContextPath(portletId);
         String applicationName = applicationId;
-        if (applicationName.length() > 0)
-        {
-            applicationName = applicationName.substring(1);
-        }
+//        if (applicationName.length() > 0)
+//        {
+//            applicationName = applicationName.substring(1);
+//        }
         String portletName = PortletWindowConfig.parsePortletName(portletId);
 
         if (portletRegistry == null)
@@ -261,10 +257,10 @@ public class SupportedModesServiceImpl i
     {
         String applicationId = PortletWindowConfig.parseContextPath(portletId);
         String applicationName = applicationId;
-        if (applicationName.length() > 0)
-        {
-            applicationName = applicationName.substring(1);
-        }
+//        if (applicationName.length() > 0)
+//        {
+//            applicationName = applicationName.substring(1);
+//        }
         String portletName = PortletWindowConfig.parsePortletName(portletId);
 
         return portletContextService.getPortletConfig(applicationName, portletName);

Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java?rev=944069&r1=944068&r2=944069&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java Fri May 14 00:38:15 2010
@@ -162,10 +162,6 @@ public class SupportedWindowStateService
 
         String appId = PortletWindowConfig.parseContextPath(portletId);
         String applicationName = appId;
-        if (applicationName.length() > 0)
-        {
-            applicationName = applicationName.substring(1);
-        }
         PortletApplicationDefinition portletAppDD = null;
 
         if (portletRegistry == null)

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java?rev=944069&r1=944068&r2=944069&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortletContextManager.java Fri May 14 00:38:15 2010
@@ -114,19 +114,18 @@ public class PortletContextManager imple
 	public String register(ServletConfig config) throws PortletContainerException {
 	    ServletContext servletContext = config.getServletContext();
 	    String contextPath = getContextPath(servletContext);
-        String applicationName = contextPath.substring(1);
-        if (!portletContexts.containsKey(applicationName)) {
+        if (!portletContexts.containsKey(contextPath)) {
 
-            PortletApplicationDefinition portletApp = portletRegistry.getPortletAppDD(servletContext, applicationName, contextPath);
+            PortletApplicationDefinition portletApp = portletRegistry.getPortletAppDD(servletContext, contextPath, contextPath);
 
             DriverPortletContext portletContext = new DriverPortletContextImpl(servletContext, portletApp, rdService);
 
-            portletContexts.put(applicationName, portletContext);
+            portletContexts.put(contextPath, portletContext);
 
             fireRegistered(portletContext);
 
             if (LOG.isInfoEnabled()) {
-                LOG.info("Registered portlet application for context '/" + applicationName + "'");
+                LOG.info("Registered portlet application for context '" + contextPath + "'");
 
                 LOG.info("Registering "+portletApp.getPortlets().size()+" portlets for context /"+portletContext.getApplicationName());
             }
@@ -144,10 +143,10 @@ public class PortletContextManager imple
             }
         } else {
              if (LOG.isInfoEnabled()) {
-                LOG.info("Portlet application for context '/" + applicationName + "' already registered.");
+                LOG.info("Portlet application for context '" + contextPath + "' already registered.");
             }
         }
-        return applicationName;
+        return contextPath;
     }
 
     /**
@@ -262,7 +261,7 @@ public class PortletContextManager imple
         for (PortletRegistryListener l: registryListeners) {
             l.portletApplicationRegistered(event);
         }
-        LOG.info("Portlet Context '/" + context.getApplicationName() + "' registered.");
+        LOG.info("Portlet Context '" + context.getApplicationName() + "' registered.");
     }
 
     private void fireRemoved(DriverPortletContext context) {
@@ -273,7 +272,7 @@ public class PortletContextManager imple
             l.portletApplicationRemoved(event);
         }
 
-        LOG.info("Portlet Context '/" + context.getApplicationName() + "' removed.");
+        LOG.info("Portlet Context '" + context.getApplicationName() + "' removed.");
     }
 
 //

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java?rev=944069&r1=944068&r2=944069&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java Fri May 14 00:38:15 2010
@@ -59,10 +59,6 @@ public class PortletWindowImpl implement
         try
         {
             String applicationName = config.getContextPath();
-            if (applicationName.length() >0 )
-            {
-                applicationName = applicationName.substring(1);
-            }
             this.portlet = PlutoServices.getServices().getPortletRegistryService().getPortlet(applicationName, config.getPortletName());
         }
         catch (PortletContainerException ex)