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/10/16 10:42:42 UTC
svn commit: r705179 - in /portals/pluto/branches/2.0-spi-refactoring:
pluto-container-api/src/main/java/org/apache/pluto/core/
pluto-container-api/src/main/java/org/apache/pluto/internal/
pluto-container-api/src/main/java/org/apache/pluto/om/portlet/ p...
Author: ate
Date: Thu Oct 16 01:42:40 2008
New Revision: 705179
URL: http://svn.apache.org/viewvc?rev=705179&view=rev
Log:
PLUTO-509: final cleanup of the Portlet API model beans
- replacing the PortletApplicationDefinition id with the name attribute usage
Modified:
portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletContext.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApplicationDefinition.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryEvent.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet10/PortletAppType.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet20/PortletAppType.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java
portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java Thu Oct 16 01:42:40 2008
@@ -145,11 +145,11 @@
throw new PortletContainerException(msg);
}
- String applicationId = registryService.register(sConfig);
+ String applicationName = registryService.register(sConfig);
portletContext = (InternalPortletContext) registryService
- .getPortletContext(applicationId);
+ .getPortletContext(applicationName);
portletConfig = (InternalPortletConfig) registryService
- .getPortletConfig(applicationId, portletName);
+ .getPortletConfig(applicationName, portletName);
}
catch (PortletContainerException ex)
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletContext.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletContext.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletContext.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletContext.java Thu Oct 16 01:42:40 2008
@@ -27,7 +27,7 @@
* Retrieve the unique identifier for the portlet context.
* @return unique identifier.
*/
- public String getApplicationId();
+ public String getApplicationName();
/**
*
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApplicationDefinition.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApplicationDefinition.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApplicationDefinition.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApplicationDefinition.java Thu Oct 16 01:42:40 2008
@@ -32,24 +32,6 @@
*/
void setName(String name);
- /**
- * The id the Portlet Application
- * <br/>
- * Note: for the Pluto container default descriptor implementation this equals
- * to the contextPath of the Web Applications
- * @return
- */
- String getId();
-
- /**
- * Set the id the Portlet Application
- * <br/>
- * Note: for the Pluto container default descriptor implementation this equals
- * to the contextPath of the Web Applications
- * @return
- */
- void setId(String id);
-
PortletDefinition getPortlet(String portletName);
/**
* Retrieve the portlets which exist within this application.
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryEvent.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryEvent.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryEvent.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryEvent.java Thu Oct 16 01:42:40 2008
@@ -26,16 +26,16 @@
*/
public class PortletRegistryEvent {
- private String applicationId;
+ private String applicationName;
private PortletApplicationDefinition portletApplication;
- public String getApplicationId() {
- return applicationId != null ? applicationId : portletApplication.getId();
+ public String getApplicationName() {
+ return applicationName != null ? applicationName : portletApplication.getName();
}
- public void setApplicationId(String applicationId) {
- this.applicationId = applicationId;
+ public void setApplicationName(String applicationName) {
+ this.applicationName = applicationName;
}
public PortletApplicationDefinition getPortletApplication() {
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java Thu Oct 16 01:42:40 2008
@@ -50,64 +50,64 @@
Iterator<InternalPortletContext> getPortletContexts();
/**
- * Retrieve the ids of all registered applications.
+ * Retrieve the names of all registered applications.
* This list will only contain those applications
* which have been registered with the container.
* Others may or may not be available within
* the servers.
*
- * @return iterator of all PortletApp ids (strings).
+ * @return iterator of all PortletApp names (strings).
*/
- Iterator<String> getRegisteredPortletApplicationIds();
+ Iterator<String> getRegisteredPortletApplicationNames();
/**
* Retrieve the PortletApp for the specified
- * portlet application id.
+ * portlet application Name.
*
- * @param applicationId the id of the portlet application.
+ * @param applicationName the name of the portlet application.
* @return the named PortletApp.
* @throws PortletContainerException if the portlet application
* isn't registered.
*/
- PortletApplicationDefinition getPortletApplication(String applicationId)
+ PortletApplicationDefinition getPortletApplication(String applicationName)
throws PortletContainerException;
/**
- * Retrieve the InternalPortletContext for the specified portlet application id
+ * Retrieve the InternalPortletContext for the specified portlet application name
*
- * @param applicationId portlet application id
+ * @param applicationName portlet application name
* @return portlet context or null if not registered
*/
- InternalPortletContext getPortletContext(String applicationId)
+ InternalPortletContext getPortletContext(String applicationName)
throws PortletContainerException;
/**
* Retreive the Portlet for the specified portlet.
*
- * @param applicationId portlet application id
+ * @param applicationId portlet application name
* @param portletName portlet name
* @return portlet
* @throws PortletContainerException if portlet or application unknown
*/
- PortletDefinition getPortlet(String applicationId, String portletName)
+ PortletDefinition getPortlet(String applicationName, String portletName)
throws PortletContainerException;
/**
* Retrieve the portlet configuration for the specified portlet
- * @param applicationIid portlet application id
+ * @param applicationName portlet application name
* @param portletName portlet name
* @return portletconfig
* @throws PortletContainerException if portlet or application unknown
*/
- InternalPortletConfig getPortletConfig(String applicationId, String portletName)
+ InternalPortletConfig getPortletConfig(String applicationName, String portletName)
throws PortletContainerException;
/**
* Retrieve the ClassLoader of the specified portlet application
- * @param applicationId portlet application id
+ * @param applicationId portlet application name
* @return classLoader
*/
- ClassLoader getClassLoader(String applicationId)
+ ClassLoader getClassLoader(String applicationName)
throws PortletContainerException;
/**
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java Thu Oct 16 01:42:40 2008
@@ -170,8 +170,8 @@
InternalRenderResponse renderResponse = getOptionalContainerServices().getPortletEnvironmentService()
.createRenderResponse(this, request, response, portletWindow);
- String appId = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getId();
- InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appId);
+ String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
+ InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
@@ -215,8 +215,8 @@
InternalResourceResponse resourceResponse = getOptionalContainerServices().getPortletEnvironmentService()
.createResourceResponse(this, request, response, portletWindow);
- String appId = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getId();
- InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appId);
+ String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
+ InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
@@ -259,8 +259,8 @@
InternalActionResponse actionResponse = getOptionalContainerServices().getPortletEnvironmentService()
.createActionResponse(this, request, response, portletWindow);
- String appId = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getId();
- InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appId);
+ String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
+ InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
@@ -336,8 +336,8 @@
getOptionalContainerServices().getPortletEnvironmentService()
.createRenderResponse(this, request, response, portletWindow);
- String appId = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getId();
- InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appId);
+ String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
+ InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
@@ -367,8 +367,8 @@
InternalPortletResponse internalResponse =
new AdminResponse(this, portletWindow, servletRequest, servletResponse);
- String appId = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getId();
- InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appId);
+ String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
+ InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
@@ -429,8 +429,8 @@
this, window, request, response);
- String appId = window.getPortletEntity().getPortletDefinition().getApplication().getId();
- InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appId);
+ String appName = window.getPortletEntity().getPortletDefinition().getApplication().getName();
+ InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java Thu Oct 16 01:42:40 2008
@@ -111,58 +111,54 @@
*/
public String register(ServletConfig config) throws PortletContainerException {
ServletContext servletContext = config.getServletContext();
- String applicationId = getContextPath(servletContext);
- if (!portletContexts.containsKey(applicationId)) {
+ String applicationName = getContextPath(servletContext).substring(1);
+ if (!portletContexts.containsKey(applicationName)) {
PortletDescriptorRegistry portletRegistry = PortletDescriptorRegistry.getRegistry();
PortletApplicationDefinition portletApp = portletRegistry.getPortletAppDD(servletContext);
- portletApp.setId(applicationId);
- portletApp.setName(applicationId.substring(1));
+ portletApp.setName(applicationName);
InternalPortletContext portletContext = new PortletContextImpl(servletContext, portletApp);
- if (portletContext.getApplicationId() == null) {
- throw new IllegalStateException("Unable to resolve unique identifier for portlet context.");
- }
- portletContexts.put(applicationId, portletContext);
+ portletContexts.put(applicationName, portletContext);
fireRegistered(portletContext);
if (LOG.isInfoEnabled()) {
- LOG.info("Registered portlet application with application id '" + applicationId + "'");
+ LOG.info("Registered portlet application for context '/" + applicationName + "'");
- LOG.info("Registering "+portletApp.getPortlets().size()+" portlets for context "+portletContext.getApplicationId());
+ LOG.info("Registering "+portletApp.getPortlets().size()+" portlets for context /"+portletContext.getApplicationName());
- classLoaders.put(portletApp.getId(), Thread.currentThread().getContextClassLoader());
+ classLoaders.put(portletApp.getName(), Thread.currentThread().getContextClassLoader());
for (PortletDefinition portlet: portletApp.getPortlets()) {
portletConfigs.put(
- portletContext.getApplicationId() + "/" + portlet.getPortletName(),
+ portletContext.getApplicationName() + "/" + portlet.getPortletName(),
new PortletConfigImpl(config, portletContext, portlet, portletApp)
);
}
}
} else {
if (LOG.isInfoEnabled()) {
- LOG.info("Portlet application with application id '" + applicationId + "' already registered.");
+ LOG.info("Portlet application for context '/" + applicationName + "' already registered.");
}
}
- return applicationId;
+ return applicationName;
}
public void remove(InternalPortletContext context) {
- portletContexts.remove(context.getApplicationId());
- classLoaders.remove(context.getApplicationId());
+ portletContexts.remove(context.getApplicationName());
+ classLoaders.remove(context.getApplicationName());
Iterator<String> configs = portletConfigs.keySet().iterator();
while (configs.hasNext()) {
String key = configs.next();
- if (key.startsWith(context.getApplicationId() + "/")) {
+ if (key.startsWith(context.getApplicationName() + "/")) {
configs.remove();
}
}
fireRemoved(context);
}
- public Iterator<String> getRegisteredPortletApplicationIds() {
+ public Iterator<String> getRegisteredPortletApplicationNames() {
return new HashSet<String>(portletContexts.keySet()).iterator();
}
@@ -174,42 +170,42 @@
return new HashSet<InternalPortletContext>(portletContexts.values()).iterator();
}
- public InternalPortletContext getPortletContext(String applicationId) {
- return portletContexts.get(applicationId);
+ public InternalPortletContext getPortletContext(String applicationName) {
+ return portletContexts.get(applicationName);
}
- public InternalPortletConfig getPortletConfig(String applicationId, String portletName) throws PortletContainerException {
- InternalPortletConfig ipc = portletConfigs.get(applicationId + "/" + portletName);
+ public InternalPortletConfig getPortletConfig(String applicationName, String portletName) throws PortletContainerException {
+ InternalPortletConfig ipc = portletConfigs.get(applicationName + "/" + portletName);
if (ipc != null) {
return ipc;
}
- String msg = "Unable to locate portlet config [applicationId="+applicationId+"]/["+portletName+"].";
+ String msg = "Unable to locate portlet config [applicationName="+applicationName+"]/["+portletName+"].";
LOG.warn(msg);
throw new PortletContainerException(msg);
}
- public PortletDefinition getPortlet(String applicationId, String portletName) throws PortletContainerException {
- InternalPortletConfig ipc = portletConfigs.get(applicationId + "/" + portletName);
+ public PortletDefinition getPortlet(String applicationName, String portletName) throws PortletContainerException {
+ InternalPortletConfig ipc = portletConfigs.get(applicationName + "/" + portletName);
if (ipc != null) {
return ipc.getPortletDefinition();
}
- String msg = "Unable to retrieve portlet: '"+applicationId+"/"+portletName+"'";
+ String msg = "Unable to retrieve portlet: '"+applicationName+"/"+portletName+"'";
LOG.warn(msg);
throw new PortletContainerException(msg);
}
- public PortletApplicationDefinition getPortletApplication(String applicationId) throws PortletContainerException {
- InternalPortletContext ipc = portletContexts.get(applicationId);
+ public PortletApplicationDefinition getPortletApplication(String applicationName) throws PortletContainerException {
+ InternalPortletContext ipc = portletContexts.get(applicationName);
if (ipc != null) {
return ipc.getPortletApplicationDefinition();
}
- String msg = "Unable to retrieve portlet application: '"+applicationId+"'";
+ String msg = "Unable to retrieve portlet application: '"+applicationName+"'";
LOG.warn(msg);
throw new PortletContainerException(msg);
}
- public ClassLoader getClassLoader(String applicationId){
- return classLoaders.get(applicationId);
+ public ClassLoader getClassLoader(String applicationName){
+ return classLoaders.get(applicationName);
}
public void addPortletRegistryListener(PortletRegistryListener listener) {
@@ -227,7 +223,7 @@
for (PortletRegistryListener l: registryListeners) {
l.portletApplicationRegistered(event);
}
- LOG.info("Portlet Context '" + context.getApplicationId() + "' registered.");
+ LOG.info("Portlet Context '/" + context.getApplicationName() + "' registered.");
}
private void fireRemoved(InternalPortletContext context) {
@@ -238,7 +234,7 @@
l.portletApplicationRemoved(event);
}
- LOG.info("Portlet Context '" + context.getApplicationId() + "' removed.");
+ LOG.info("Portlet Context '/" + context.getApplicationName() + "' removed.");
}
//
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet10/PortletAppType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet10/PortletAppType.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet10/PortletAppType.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet10/PortletAppType.java Thu Oct 16 01:42:40 2008
@@ -83,8 +83,6 @@
@XmlAttribute(required = true)
protected String version;
@XmlTransient
- protected String id;
- @XmlTransient
protected String name;
public String getName()
@@ -354,14 +352,4 @@
{
version = value;
}
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String value)
- {
- id = value;
- }
}
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet20/PortletAppType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet20/PortletAppType.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet20/PortletAppType.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/descriptors/portlet20/PortletAppType.java Thu Oct 16 01:42:40 2008
@@ -114,8 +114,6 @@
protected List<ContainerRuntimeOption> containerRuntimeOption;
@XmlAttribute(required = true)
protected String version;
- @XmlTransient
- protected String id;
@XmlTransient
protected String name;
@@ -541,14 +539,4 @@
{
version = value;
}
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String value)
- {
- id = value;
- }
}
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java Thu Oct 16 01:42:40 2008
@@ -18,9 +18,12 @@
import java.io.InputStream;
import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.portlet.PortletContext;
import javax.portlet.PortletRequestDispatcher;
@@ -56,8 +59,6 @@
/** Portlet */
private PortletDefinition portlet = null;
- private String applicationName;
-
private final PortletApplicationDefinition portletApp;
private final ServletContext servletContext;
private ClassLoader contextClassLoader;
@@ -74,11 +75,6 @@
PortletApplicationDefinition portletApp) {
this.servletContext = servletContext;
this.portletApp = portletApp;
- this.applicationName = servletContext.getServletContextName();
-
- if(applicationName == null) {
- applicationName = portletApp.getId();
- }
init();
}
@@ -86,14 +82,10 @@
setContextClassLoader(Thread.currentThread().getContextClassLoader());
}
- public String getApplicationId() {
- return portletApp.getId();
- }
-
public String getApplicationName() {
- return applicationName;
+ return portletApp.getName();
}
-
+
/**
* ClassLoader associated with this context.
* @return
@@ -197,11 +189,12 @@
return servletContext.getRealPath(path);
}
- public java.util.Set getResourcePaths(String path) {
+ @SuppressWarnings("unchecked")
+ public Set<String> getResourcePaths(String path) {
return servletContext.getResourcePaths(path);
}
- public java.net.URL getResource(String path)
+ public URL getResource(String path)
throws java.net.MalformedURLException {
if (path == null || !path.startsWith("/")) {
throw new MalformedURLException("path must start with a '/'");
@@ -209,7 +202,7 @@
return servletContext.getResource(path);
}
- public java.lang.Object getAttribute(java.lang.String name) {
+ public Object getAttribute(java.lang.String name) {
if (name == null) {
throw new IllegalArgumentException("Attribute name == null");
}
@@ -217,11 +210,12 @@
return servletContext.getAttribute(name);
}
- public java.util.Enumeration getAttributeNames() {
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getAttributeNames() {
return servletContext.getAttributeNames();
}
- public java.lang.String getInitParameter(java.lang.String name) {
+ public String getInitParameter(java.lang.String name) {
if (name == null) {
throw new IllegalArgumentException("Parameter name == null");
}
@@ -229,7 +223,8 @@
return servletContext.getInitParameter(name);
}
- public java.util.Enumeration getInitParameterNames() {
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getInitParameterNames() {
return servletContext.getInitParameterNames();
}
@@ -237,11 +232,11 @@
servletContext.log(msg);
}
- public void log(java.lang.String message, java.lang.Throwable throwable) {
+ public void log(java.lang.String message, Throwable throwable) {
servletContext.log(message, throwable);
}
- public void removeAttribute(java.lang.String name) {
+ public void removeAttribute(String name) {
if (name == null) {
throw new IllegalArgumentException("Attribute name == null");
}
@@ -249,7 +244,7 @@
servletContext.removeAttribute(name);
}
- public void setAttribute(java.lang.String name, java.lang.Object object) {
+ public void setAttribute(String name, Object object) {
if (name == null) {
throw new IllegalArgumentException("Attribute name == null");
}
@@ -308,7 +303,7 @@
}
- public java.util.Enumeration<String> getContainerRuntimeOptions() {
+ public Enumeration<String> getContainerRuntimeOptions() {
Map<String,String[]> appRuntimeOptions = getApplicationRuntimeOptions();
Map<String,String[]> portletRuntimeOptions = getPortletRuntimeOptions();
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java Thu Oct 16 01:42:40 2008
@@ -367,11 +367,11 @@
}
public String getContextPath() {
- String contextPath = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getId();
- if ("/".equals(contextPath)) {
- contextPath = "";
+ String name = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
+ if (!name.equals("")) {
+ name = "/" + name;
}
- return contextPath;
+ return name;
}
public String getRemoteUser() {
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.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/container/PortletWindowThread.java?rev=705179&r1=705178&r2=705179&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java Thu Oct 16 01:42:40 2008
@@ -106,7 +106,7 @@
// now test if object is jaxb
EventDefinition eventDefinitionDD = getEventDefintion(event.getQName());
- ClassLoader loader = portletRegistry.getClassLoader(portletWindow.getPortletEntity().getPortletDefinition().getApplication().getId());
+ ClassLoader loader = portletRegistry.getClassLoader(portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName());
Class<? extends Serializable> clazz = loader.loadClass(eventDefinitionDD.getValueType()).asSubclass(Serializable.class);
JAXBContext jc = JAXBContext.newInstance(clazz);