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 at...@apache.org on 2008/05/03 13:44:34 UTC

svn commit: r653055 - /portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java

Author: ate
Date: Sat May  3 04:44:34 2008
New Revision: 653055

URL: http://svn.apache.org/viewvc?rev=653055&view=rev
Log:
Removing an unused dependency on the PortletContextManager.
This was more or less dead code (the driving Map portletApps is never filled) and I traced it back to a commit from Graig (r606023)
and this JIRA comment https://issues.apache.org/jira/browse/PLUTO-371?focusedCommentId=12552555#action_12552555
but I fail to see how this could have done anything good.
After removing this code, the TCK (2.0) still passes so I guess the mentioned problem has been fixed otherwise. 

Modified:
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java?rev=653055&r1=653054&r2=653055&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java Sat May  3 04:44:34 2008
@@ -31,7 +31,6 @@
 import org.apache.pluto.PortletContainerException;
 import org.apache.pluto.driver.AttributeKeys;
 import org.apache.pluto.driver.config.DriverConfigurationException;
-import org.apache.pluto.driver.services.portal.PortletApplicationConfig;
 import org.apache.pluto.driver.services.portal.PortletWindowConfig;
 import org.apache.pluto.driver.services.portal.PropertyConfigService;
 import org.apache.pluto.driver.services.portal.SupportedModesService;
@@ -56,9 +55,6 @@
     /** Logger */
     private static final Log LOG = LogFactory.getLog(SupportedModesServiceImpl.class);
 
-    /** PortletApplicationConfig objects keyed by their String context path */
-    private Map portletApps = new HashMap();
-
     /** Sets containing PortletMode objects keyed by String portlet Id */
     private Map supportedPortletModesByPortlet = new HashMap();
     
@@ -150,16 +146,13 @@
         LOG.debug("Destroying Supported Modes Service...");
         supportedPortletModesByPortal = null;
         portletRegistry = null;
-        portletApps = null;        
         propertyService = null;
-//        FilterManagerImpl.removeAllFilterApps();
         LOG.debug("Supported Modes Service destroyed.");
     }
 
     public void init(ServletContext ctx) throws DriverConfigurationException {
         this.servletContext = ctx;
         loadPortalModes();
-        loadPortletModes();        
     }    
     
 
@@ -178,59 +171,6 @@
         LOG.debug("Loaded [" + supportedPortletModesByPortal.size() + "] supported portal modes");
     }
     
-    /** 
-     * Populates the supportedPortletModesByPortlet map, which contains
-     * Sets of PortletMode objects keyed by String portlet Ids.
-     */
-    private void loadPortletModes()
-    {                
-        // Add the PortletModes supported by each portlet to
-        // the supportedPortletModesByPortlet map.
-        LOG.debug("Loading modes supported by each Portlet...");
-        Iterator apps = portletApps.values().iterator();
-        while (apps.hasNext())
-        {
-            PortletApplicationConfig app = (PortletApplicationConfig)apps.next();            
-            PortletApp portletAppDD;
-            try {
-            	PortletContainer container = (PortletContainer)servletContext
-                	.getAttribute(AttributeKeys.PORTLET_CONTAINER);
-                portletAppDD = container
-                    .getPortletApplicationDescriptor(app.getContextPath());
-            } catch (PortletContainerException e) {
-                LOG.warn(e);
-                continue;
-            }
-            Iterator portlets = portletAppDD.getPortlets().iterator();
-            while (portlets.hasNext()) {                
-                Portlet portlet = (Portlet)portlets.next();
-                LOG.debug("Loading modes supported by portlet [" + app.getContextPath() + "]." +
-                        "[" + portlet.getPortletName() + "]");
-                Iterator supports = portlet.getSupports().iterator();
-                Set pModes = new HashSet();
-                while (supports.hasNext())
-                {
-                    Supports supportsDD = (Supports)supports.next();
-                    if (supportsDD.getPortletModes()!=null){
-                    	Iterator portletModes = supportsDD.getPortletModes().iterator();
-                    
-	                    while (portletModes.hasNext())
-	                    {
-	                        PortletMode pMode = new PortletMode((String)portletModes.next());
-	                        LOG.debug("Adding mode [" + pMode + "]");
-	                        pModes.add(pMode);                                
-	                    }
-                    }
-                }
-                
-                supportedPortletModesByPortlet.put(
-                        PortletWindowConfig.createPortletId(app.getContextPath(), portlet.getPortletName(), null), 
-                        pModes);                     
-            } 
-        }
-    }
-    
-
 	public boolean isPortletManagedMode(String portletId, String mode) {
 		//FIXME: This needs to be implemented properly:
 		// 1. Need to create a Map of custom modes (CustomModeDD) keyed by portlet ID in init().