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 dd...@apache.org on 2007/02/04 04:02:40 UTC
svn commit: r503345 - in /portals/pluto/trunk:
pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/
pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/
pluto-portal-driver/src/main/java/org/apac...
Author: ddewolf
Date: Sat Feb 3 19:02:39 2007
New Revision: 503345
URL: http://svn.apache.org/viewvc?view=rev&rev=503345
Log:
PLUTO-275; Two windows of the same instance can now be placed on the same page
Removed:
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PortletRegistryServiceImpl.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PortletApplicationConfig.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PortletRegistryService.java
Modified:
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfig.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfigReader.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PageConfig.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PortletWindowConfig.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletModeAnchorTag.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
portals/pluto/trunk/pluto-portal-driver/src/test/java/org/apache/pluto/driver/services/portal/PortletWindowConfigTest.java
portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java Sat Feb 3 19:02:39 2007
@@ -21,8 +21,6 @@
import org.apache.pluto.driver.config.DriverConfiguration;
import org.apache.pluto.driver.services.portal.PageConfig;
-import org.apache.pluto.driver.services.portal.PortletApplicationConfig;
-import org.apache.pluto.driver.services.portal.PortletRegistryService;
import org.apache.pluto.driver.services.portal.PortletWindowConfig;
import org.apache.pluto.driver.services.portal.PropertyConfigService;
import org.apache.pluto.driver.services.portal.RenderConfigService;
@@ -43,7 +41,6 @@
private PortalURLParser portalUrlParser;
private PropertyConfigService propertyService;
- private PortletRegistryService registryService;
private RenderConfigService renderService;
private SupportedModesService supportedModesService;
@@ -53,13 +50,11 @@
public DriverConfigurationImpl(PortalURLParser portalUrlParser,
PropertyConfigService propertyService,
- PortletRegistryService registryService,
RenderConfigService renderService,
PortalCallbackService portalCallback,
SupportedModesService supportedModesService) {
this.portalUrlParser = portalUrlParser;
this.propertyService = propertyService;
- this.registryService = registryService;
this.renderService = renderService;
this.portalCallbackService = portalCallback;
this.supportedModesService = supportedModesService;
@@ -107,32 +102,6 @@
/**
* Standard Getter.
- * @return the configuration data of all configured portlet applications.
- */
- public Collection getPortletApplications() {
- return registryService.getPortletApplications();
- }
-
- /**
- * Retrieve the portlet application with the given id.
- * @param id the id of the portlet application.
- * @return the portlet application configuration data.
- */
- public PortletApplicationConfig getPortletApp(String id) {
- return registryService.getPortletApplication(id);
- }
-
- /**
- * Retrieve the window configuration associated with the given id.
- * @param id the id of the portlet window.
- * @return the portlet window configuration data.
- */
- public PortletWindowConfig getPortletWindowConfig(String id) {
- return registryService.getPortlet(id);
- }
-
- /**
- * Standard Getter.
* @return the render configuration.
*/
public Collection getPages() {
@@ -157,7 +126,6 @@
public void init(ServletContext context) {
this.propertyService.init(context);
- this.registryService.init(context);
this.renderService.init(context);
this.supportedModesService.init(context);
}
@@ -165,9 +133,6 @@
public void destroy() {
if(propertyService != null)
propertyService.destroy();
-
- if(registryService != null)
- registryService.destroy();
if(renderService != null)
renderService.destroy();
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java Sat Feb 3 19:02:39 2007
@@ -17,6 +17,8 @@
import org.apache.pluto.driver.config.DriverConfigurationException;
import org.apache.pluto.driver.services.portal.*;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
import javax.servlet.ServletContext;
import java.util.Set;
@@ -33,6 +35,9 @@
public class PropertyConfigServiceImpl implements
PropertyConfigService {
+ private static final Log LOG =
+ LogFactory.getLog(PropertyConfigServiceImpl.class);
+
private ResourceConfig config;
public PropertyConfigServiceImpl() {
@@ -49,6 +54,7 @@
config = ResourceConfigReader.getFactory().parse(in);
}
catch(Exception e) {
+ LOG.error("Unable to parse resource config "+e.getMessage(), e);
throw new DriverConfigurationException(e);
}
}
@@ -81,7 +87,4 @@
return config.getSupportedWindowStates();
}
- public Set getPortletApplications() {
- return config.getPortletApplications();
- }
}
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java Sat Feb 3 19:02:39 2007
@@ -83,22 +83,6 @@
return config.getSupportedWindowStates();
}
- public Set getPortletApplications() {
- return config.getPortletApplications();
- }
-
- public PortletApplicationConfig getPortletApplication(String id) {
- return config.getPortletApp(id);
- }
-
- public PortletWindowConfig getPortletWindowConfig(String id) {
- return config.getPortletWindowConfig(id);
- }
-
- public PortletWindowConfig getPortlet(String id) {
- return config.getPortletWindowConfig(id);
- }
-
public List getPages() {
return config.getRenderConfig().getPages();
}
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfig.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfig.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfig.java Sat Feb 3 19:02:39 2007
@@ -17,7 +17,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.driver.services.portal.PortletApplicationConfig;
import org.apache.pluto.driver.services.portal.PortletWindowConfig;
import org.apache.pluto.driver.services.portal.RenderConfig;
@@ -164,58 +163,6 @@
/**
* Standard Getter.
- * @return the configuration data of all configured portlet applications.
- */
- public Set getPortletApplications() {
- return new HashSet(portletApplications.values());
- }
-
- /**
- * Add a porltet applicaiton conofiguration to this list of portlet apps.
- * @param app portlet application coniguration data.
- */
- public void addPortletApp(PortletApplicationConfig app) {
- if (LOG.isDebugEnabled()) {
- LOG.debug(
- " - - Adding PortletApp ResourceConfig for: " +
- app.getContextPath());
- }
- portletApplications.put(app.getContextPath(), app);
- }
-
- /**
- * Retrieve the portlet application with the given id.
- * @param id the id of the portlet application.
- * @return the portlet application configuration data.
- */
- public PortletApplicationConfig getPortletApp(String id) {
- return (PortletApplicationConfig) portletApplications.get(id);
- }
-
- /**
- * Retrieve the window configuration associated with the given id.
- * @param id the id of the portlet window.
- * @return the portlet window configuration data.
- */
- public PortletWindowConfig getPortletWindowConfig(String id) {
- if (id == null) {
- return null;
- }
- String context = getContextFromPortletId(id);
- String portlet = getPortletNameFromPortletId(id);
-
- PortletApplicationConfig app = getPortletApp(context);
- if (app == null) {
- if (LOG.isErrorEnabled()) {
- LOG.error("Portlet Application '" + context + "' not found.");
- }
- return null;
- }
- return app.getPortlet(portlet);
- }
-
- /**
- * Standard Getter.
* @return the render configuration.
*/
public RenderConfig getRenderConfig() {
@@ -230,36 +177,5 @@
this.renderConfig = renderConfig;
}
- /**
- * Retrieve the id of the context from the portlet id.
- * @param portletId the id of the portlet.
- * @return the context, derived from the portlet id.
- */
- private String getContextFromPortletId(String portletId) {
- if (portletId == null) {
- throw new NullPointerException("Portlet ID must not be null.");
- }
- int idx = portletId.lastIndexOf(".");
- if (idx < 0) {
- throw new IllegalArgumentException("Portlet ID does not contain a dot.");
- }
- return portletId.substring(0, idx);
- }
-
- /**
- * Retreive the porlet name from the given portletId.
- * @param portletId the portlet id.
- * @return the name of the portlet.
- */
- private String getPortletNameFromPortletId(String portletId) {
- if (portletId == null) {
- throw new NullPointerException("Portlet ID must not be null.");
- }
- int idx = portletId.lastIndexOf(".");
- if (idx < 0) {
- throw new IllegalArgumentException("Portlet ID does not contain a dot.");
- }
- return portletId.substring(idx + 1);
- }
}
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfigReader.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfigReader.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfigReader.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ResourceConfigReader.java Sat Feb 3 19:02:39 2007
@@ -18,7 +18,6 @@
import org.apache.commons.digester.Digester;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.driver.services.portal.PortletApplicationConfig;
import org.apache.pluto.driver.services.portal.PortletWindowConfig;
import org.apache.pluto.driver.services.portal.PageConfig;
import org.apache.pluto.driver.services.portal.RenderConfig;
@@ -96,28 +95,6 @@
"pluto-portal-driver/supports/window-state",
"addSupportedWindowState", 0
);
-
- digester.addObjectCreate(
- "pluto-portal-driver/portlet-app",
- PortletApplicationConfig.class
- );
- digester.addBeanPropertySetter(
- "pluto-portal-driver/portlet-app/context-path", "contextPath"
- );
-
- digester.addObjectCreate(
- "pluto-portal-driver/portlet-app/portlets/portlet",
- PortletWindowConfig.class
- );
- digester.addSetProperties(
- "pluto-portal-driver/portlet-app/portlets/portlet", "name",
- "portletName"
- );
- digester.addSetNext(
- "pluto-portal-driver/portlet-app/portlets/portlet",
- "addPortlet"
- );
- digester.addSetNext("pluto-portal-driver/portlet-app", "addPortletApp");
digester.addObjectCreate(
"pluto-portal-driver/render-config",
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java Sat Feb 3 19:02:39 2007
@@ -94,14 +94,16 @@
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
-
PortalRequestContext portalRequestContext =
new PortalRequestContext(getServletContext(), request, response);
PortalURL portalURL = portalRequestContext.getRequestedPortalURL();
String actionWindowId = portalURL.getActionWindow();
- PortletWindowConfig actionWindowConfig = getDriverConfiguration()
- .getPortletWindowConfig(actionWindowId);
+
+ PortletWindowConfig actionWindowConfig =
+ actionWindowId == null
+ ? null
+ : PortletWindowConfig.fromId(actionWindowId);
// Action window config will only exist if there is an action request.
if (actionWindowConfig != null) {
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java Sat Feb 3 19:02:39 2007
@@ -15,7 +15,6 @@
*/
package org.apache.pluto.driver.config;
-import org.apache.pluto.driver.services.portal.PortletApplicationConfig;
import org.apache.pluto.driver.services.portal.PortletWindowConfig;
import org.apache.pluto.driver.services.portal.PageConfig;
import org.apache.pluto.driver.url.PortalURLParser;
@@ -87,12 +86,6 @@
Collection getSupportedPortletModes();
Collection getSupportedWindowStates();
-
- Collection getPortletApplications();
-
- PortletApplicationConfig getPortletApp(String id);
-
- PortletWindowConfig getPortletWindowConfig(String id);
Collection getPages();
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PageConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PageConfig.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PageConfig.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PageConfig.java Sat Feb 3 19:02:39 2007
@@ -59,8 +59,9 @@
}
public void addPortlet(String contextPath, String portletName) {
- portletIds.add(
- PortletWindowConfig.createPortletId(contextPath, portletName));
+ synchronized(portletIds) {
+ portletIds.add(PortletWindowConfig.createPortletId(contextPath, portletName, createPlacementId()));
+ }
}
public void removePortlet(String portletId) {
@@ -75,5 +76,8 @@
return orderNumber;
}
+ private String createPlacementId() {
+ return getName().hashCode() + "|"+portletIds.size();
+ }
}
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PortletWindowConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PortletWindowConfig.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PortletWindowConfig.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PortletWindowConfig.java Sat Feb 3 19:02:39 2007
@@ -15,6 +15,8 @@
*/
package org.apache.pluto.driver.services.portal;
+import java.util.Random;
+
/**
* Configuration of a portlet window on the portal page.
* @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
@@ -23,13 +25,15 @@
public class PortletWindowConfig {
// Private Member Variables ------------------------------------------------
-
+
/** The context path of the associated portlet. */
private String contextPath = null;
/** The portlet name. */
private String portletName = null;
-
+
+ /** The metaInfo that provides uniqueness across window ids. */
+ private String metaInfo = null;
// Constructor -------------------------------------------------------------
@@ -37,14 +41,19 @@
* No-arg constructor.
*/
public PortletWindowConfig() {
- // Do nothing.
+
}
-
-
+
+ private PortletWindowConfig(String contextPath, String portletName, String metaInfo) {
+ this.contextPath = contextPath;
+ this.portletName = portletName;
+ this.metaInfo = metaInfo;
+ }
+
// Public Methods ----------------------------------------------------------
public String getId() {
- return createPortletId(contextPath, portletName);
+ return createPortletId(contextPath, portletName, metaInfo);
}
public String getContextPath() {
@@ -62,8 +71,15 @@
public void setPortletName(String portletName) {
this.portletName = portletName;
}
-
-
+
+ public String getMetaInfo() {
+ return metaInfo;
+ }
+
+ public void setMetaInfo(String metaInfo) {
+ this.metaInfo = metaInfo;
+ }
+
// Public Static Methods ---------------------------------------------------
/**
@@ -79,7 +95,7 @@
* @throws IllegalArgumentException if the portletName has a dot
* @throws NullPointerException if the portlet Name or context path is null.
*/
- public static String createPortletId(String contextPath, String portletName)
+ public static String createPortletId(String contextPath, String portletName, String metaInfo)
throws NullPointerException, IllegalArgumentException {
if (contextPath == null) {
@@ -91,7 +107,11 @@
if (portletName.indexOf('.') != -1) {
throw new IllegalArgumentException("Portlet name must not have a dot(period). Please remove the dot from the value of the portlet-name element ("+ portletName + ") in portlet.xml");
}
- return contextPath + "." + portletName;
+
+ if(metaInfo == null) {
+ metaInfo = "";
+ }
+ return contextPath + "." + portletName + "!" + metaInfo;
}
/**
@@ -111,7 +131,14 @@
*/
public static String parsePortletName(String portletId) {
int index = getSeparatorIndex(portletId);
- return portletId.substring(index + 1);
+ String postfix = portletId.substring(index + 1);
+ index = postfix.indexOf("!");
+ return postfix.substring(0, index);
+ }
+
+ public static String parseMetaInfo(String portletId) {
+ int index = portletId.indexOf("!");
+ return portletId.substring(index+1);
}
@@ -130,16 +157,22 @@
*/
private static int getSeparatorIndex(String portletId)
throws NullPointerException, IllegalArgumentException {
-
if (portletId == null) {
throw new NullPointerException("Portlet ID is null");
}
- int index = portletId.lastIndexOf(".");
+
+ int index = portletId.lastIndexOf(".");
if (index <= 0 || index == portletId.length() - 1) {
throw new IllegalArgumentException("Portlet ID '" + portletId + "' does not contain a dot or the dot is the first or last character");
}
return index;
}
-
+
+ public static PortletWindowConfig fromId(String portletWindowId) {
+ String contextPath = parseContextPath(portletWindowId);
+ String portletName = parsePortletName(portletWindowId);
+ String metaInfo = parseMetaInfo(portletWindowId);
+ return new PortletWindowConfig(contextPath, portletName, metaInfo);
+ }
}
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletModeAnchorTag.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletModeAnchorTag.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletModeAnchorTag.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletModeAnchorTag.java Sat Feb 3 19:02:39 2007
@@ -83,10 +83,8 @@
ServletContext servletContext = pageContext.getServletContext();
DriverConfiguration driverConfig = (DriverConfiguration)
servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);
- PortletWindowConfig windowConfig = driverConfig
- .getPortletWindowConfig(evaluatedPortletId);
- if (isPortletModeAllowed(driverConfig, windowConfig, portletMode)) {
+ if (isPortletModeAllowed(driverConfig, portletMode)) {
// Retrieve the portal environment.
PortalRequestContext portalEnv = PortalRequestContext.getContext(
(HttpServletRequest) pageContext.getRequest());
@@ -157,8 +155,8 @@
this.portletMode = portletMode;
}
- private boolean isPortletModeAllowed(DriverConfiguration config, PortletWindowConfig window, String mode) {
- LOG.debug("Testing if PortletWindowConfig [" + Integer.toHexString(window.hashCode()) + "] supports mode [" + mode + "]");
+ private boolean isPortletModeAllowed(DriverConfiguration config, String mode) {
+ LOG.debug("Testing if PortletWindowConfig [" + getEvaluatedPortletId() + "] supports mode [" + mode + "]");
return config.isPortletModeSupported(getEvaluatedPortletId(), mode);
}
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java Sat Feb 3 19:02:39 2007
@@ -42,7 +42,7 @@
/**
* The portlet tag is used to render a portlet specified by the portlet ID.
*
- * @see javax.portlet.Portlet#render(RenderRequest, RenderResponse)
+ * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
* @see org.apache.pluto.PortletContainer#doRender(PortletWindow, HttpServletRequest, HttpServletResponse)
*
* @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
@@ -110,10 +110,10 @@
// Retrieve the portlet window config for the evaluated portlet ID.
ServletContext servletContext = pageContext.getServletContext();
- DriverConfiguration driverConfig = (DriverConfiguration)
- servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);
- PortletWindowConfig windowConfig = driverConfig
- .getPortletWindowConfig(evaluatedPortletId);
+
+ PortletWindowConfig windowConfig =
+ PortletWindowConfig.fromId(evaluatedPortletId);
+
if (LOG.isDebugEnabled()) {
LOG.debug("Rendering Portlet Window: " + windowConfig);
}
Modified: portals/pluto/trunk/pluto-portal-driver/src/test/java/org/apache/pluto/driver/services/portal/PortletWindowConfigTest.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/test/java/org/apache/pluto/driver/services/portal/PortletWindowConfigTest.java?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/test/java/org/apache/pluto/driver/services/portal/PortletWindowConfigTest.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/test/java/org/apache/pluto/driver/services/portal/PortletWindowConfigTest.java Sat Feb 3 19:02:39 2007
@@ -18,7 +18,6 @@
import junit.framework.TestCase;
/**
- * TODO JavaDoc
*
* @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>:
* @version 1.0
@@ -26,26 +25,29 @@
*/
public class PortletWindowConfigTest extends TestCase {
-
public void testCreatePortletId() {
- assertEquals("context.PortletName", PortletWindowConfig.createPortletId("context", "PortletName"));
- assertEquals("c.PortletName", PortletWindowConfig.createPortletId("c", "PortletName"));
- assertEquals("context.P", PortletWindowConfig.createPortletId("context", "P"));
- assertEquals("c.P", PortletWindowConfig.createPortletId("c", "P"));
+ assertEquals("context.PortletName!", PortletWindowConfig.createPortletId("context", "PortletName", ""));
+ assertEquals("c.PortletName!1234567", PortletWindowConfig.createPortletId("c", "PortletName", "1234567"));
+ assertEquals("context.P!", PortletWindowConfig.createPortletId("context", "P", ""));
+ assertEquals("c.P!", PortletWindowConfig.createPortletId("c", "P", ""));
}
public void testParsePortletName() {
- assertEquals("PortletName", PortletWindowConfig.parsePortletName("context.PortletName"));
- assertEquals("PortletName", PortletWindowConfig.parsePortletName("c.PortletName"));
- assertEquals("P", PortletWindowConfig.parsePortletName("context.P"));
- assertEquals("P", PortletWindowConfig.parsePortletName("c.P"));
+ assertEquals("PortletName", PortletWindowConfig.parsePortletName("context.PortletName!1234567"));
+ assertEquals("PortletName", PortletWindowConfig.parsePortletName("c.PortletName!1234567"));
+ assertEquals("P", PortletWindowConfig.parsePortletName("context.P!"));
+ assertEquals("P", PortletWindowConfig.parsePortletName("c.P!ABC"));
}
public void testParseContextPath() {
- assertEquals("context", PortletWindowConfig.parseContextPath("context.PortletName"));
- assertEquals("c", PortletWindowConfig.parseContextPath("c.PortletName"));
+ assertEquals("context", PortletWindowConfig.parseContextPath("context.PortletName!aasdf"));
+ assertEquals("c", PortletWindowConfig.parseContextPath("c.PortletName!1234"));
assertEquals("context", PortletWindowConfig.parseContextPath("context.P"));
assertEquals("c", PortletWindowConfig.parseContextPath("c.P"));
+ }
+
+ public void testParseMetaInfo() {
+ assertEquals("A", PortletWindowConfig.parseMetaInfo("c.p!A"));
}
public void testParseInvalidId() {
Modified: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml?view=diff&rev=503345&r1=503344&r2=503345
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml (original)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml Sat Feb 3 19:02:39 2007
@@ -66,7 +66,6 @@
<!-- ===== Portal Services ===== -->
<constructor-arg><ref bean="PortalURLParser"/></constructor-arg>
<constructor-arg><ref bean="PropertyConfigService"/></constructor-arg>
- <constructor-arg><ref bean="PortletRegistryConfig"/></constructor-arg>
<constructor-arg><ref bean="RenderConfigService"/></constructor-arg>
<constructor-arg><ref bean="SupportedModesService"/></constructor-arg>
@@ -84,7 +83,6 @@
<!-- The single top element of the administration tree -->
<!-- ================================================ -->
<bean id="AdminConfiguration" class="org.apache.pluto.driver.config.impl.AdminConfigurationImpl">
- <property name="portletRegistryAdminService"><ref bean="PortletRegistryConfig"/></property>
<property name="renderConfigAdminService"><ref bean="RenderConfigService"/></property>
</bean>
@@ -100,11 +98,6 @@
<bean id="PropertyConfigService"
class="org.apache.pluto.driver.services.impl.resource.PropertyConfigServiceImpl"
- singleton="true">
- </bean>
-
- <bean id="PortletRegistryConfig"
- class="org.apache.pluto.driver.services.impl.resource.PortletRegistryServiceImpl"
singleton="true">
</bean>