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 cz...@apache.org on 2009/04/08 10:53:18 UTC
svn commit: r763145 - in /portals/pluto/trunk:
pluto-container-api/src/main/java/org/apache/pluto/container/
pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/
pluto-container/src/main/java/org/apache/pluto/container/impl/ plut...
Author: cziegeler
Date: Wed Apr 8 08:53:16 2009
New Revision: 763145
URL: http://svn.apache.org/viewvc?rev=763145&view=rev
Log:
PLUTO-547 : Remove distinction between required and optional services; keep the distinction in the driver.
Added:
portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/OptionalContainerServices.java (with props)
portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/RequiredContainerServices.java (with props)
Removed:
portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/OptionalContainerServices.java
portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/RequiredContainerServices.java
Modified:
portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/ContainerServices.java
portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerFactory.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContextImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletPreferencesImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletSessionImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/util/StringManager.java
portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/container/impl/PortletRequestImplTest.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultOptionalContainerServices.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortalDriverServicesImpl.java
portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
Modified: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/ContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/ContainerServices.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/ContainerServices.java (original)
+++ portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/ContainerServices.java Wed Apr 8 08:53:16 2009
@@ -16,8 +16,80 @@
*/
package org.apache.pluto.container;
+import javax.portlet.PortalContext;
+/**
+ * This interface defines the services required for integration between the
+ * Pluto Portlet Container and a Portal.
+ */
+public interface ContainerServices {
+
+ /**
+ * Returns the PortalContext instance associated with this group of
+ * portlet container services.
+ * @return a PortalContext implementation.
+ */
+ PortalContext getPortalContext();
+
+ EventCoordinationService getEventCoordinationService();
+
+ /**
+ * Returns the portlet request context service implementation
+ * used by the container
+ */
+ PortletRequestContextService getPortletRequestContextService();
+
+ /**
+ * Returns the FilterManagerService
+ */
+ FilterManagerService getFilterManagerService();
+
+ /**
+ * Returns the PortletURLListenerService
+ */
+ PortletURLListenerService getPortletURLListenerService();
+
+ /**
+ * Returns the portlet preferences service implementation
+ * used by the container.
+ *
+ * @return portlet preferences service implementation.
+ */
+ PortletPreferencesService getPortletPreferencesService();
+
+ /**
+ * Returns the environment services implementation
+ * used by the container.
+ *
+ * @return portlet environment services implementation.
+ */
+ PortletEnvironmentService getPortletEnvironmentService();
+
+ /**
+ * Returns an invoker for the specified PortletWindow.
+ *
+ * @return an invoker which can be used to service the indicated portlet.
+ */
+ PortletInvokerService getPortletInvokerService();
+
+ /**
+ * Returns the user info service implementation used
+ * by the container.
+ *
+ * @return user info service
+ */
+ UserInfoService getUserInfoService();
+
+ /**
+ * Returns the NamespaceMapper used to retrieve the Portal
+ * specific PortletWindow namespace and encoding/decoding
+ * of PortletWindow parameters in a PortalURL
+ */
+ NamespaceMapper getNamespaceMapper();
-public interface ContainerServices extends RequiredContainerServices, OptionalContainerServices
-{
+ /**
+ * Returns the CC/PP profile service implementation
+ * @return a CCPPProfileServiceImplementation
+ */
+ CCPPProfileService getCCPPProfileService();
}
Modified: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java (original)
+++ portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java Wed Apr 8 08:53:16 2009
@@ -175,14 +175,8 @@
String getName();
/**
- * Retreive the required container services associated with this container.
- * @return the required container services associated with this container.
+ * Retreive the container services associated with this container.
+ * @return the container services associated with this container.
*/
- RequiredContainerServices getRequiredContainerServices();
-
- /**
- * Retrieve the optional container services associated with this contianer.
- * @return the container services provided by either the portal or the defaults.
- */
- OptionalContainerServices getOptionalContainerServices();
+ ContainerServices getContainerServices();
}
Added: portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/OptionalContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/OptionalContainerServices.java?rev=763145&view=auto
==============================================================================
--- portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/OptionalContainerServices.java (added)
+++ portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/OptionalContainerServices.java Wed Apr 8 08:53:16 2009
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.container.driver;
+
+import org.apache.pluto.container.CCPPProfileService;
+import org.apache.pluto.container.NamespaceMapper;
+import org.apache.pluto.container.PortletEnvironmentService;
+import org.apache.pluto.container.PortletInvokerService;
+import org.apache.pluto.container.PortletPreferencesService;
+import org.apache.pluto.container.UserInfoService;
+
+/**
+ * Defines the services necessary for integration between the Pluto Container
+ * and a Portal.
+ *
+ * <p>NOTE: Backwards compatibility is not garaunteed against
+ * this interface as additional services may be needed.
+ * Please extend the DefaultOptionalContainerServices
+ * class to ensure your implementation can be used without
+ * modicications in the future.</p>
+ *
+ * @since 1.1.0
+ */
+public interface OptionalContainerServices {
+
+ /**
+ * Returns the portlet preferences service implementation
+ * used by the container.
+ *
+ * @return portlet preferences service implementation.
+ */
+ PortletPreferencesService getPortletPreferencesService();
+
+ /**
+ * Returns the environment services implementation
+ * used by the container.
+ *
+ * @return portlet environment services implementation.
+ */
+ PortletEnvironmentService getPortletEnvironmentService();
+
+ /**
+ * Returns an invoker for the specified PortletWindow.
+ *
+ * @return an invoker which can be used to service the indicated portlet.
+ */
+ PortletInvokerService getPortletInvokerService();
+
+ /**
+ * Returns the user info service implementation used
+ * by the container.
+ *
+ * @return user info service
+ */
+ UserInfoService getUserInfoService();
+
+ /**
+ * Returns the NamespaceMapper used to retrieve the Portal
+ * specific PortletWindow namespace and encoding/decoding
+ * of PortletWindow parameters in a PortalURL
+ */
+ NamespaceMapper getNamespaceMapper();
+
+ /**
+ * Returns the CC/PP profile service implementation
+ * @return a CCPPProfileServiceImplementation
+ */
+ CCPPProfileService getCCPPProfileService();
+}
Propchange: portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/OptionalContainerServices.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/OptionalContainerServices.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/OptionalContainerServices.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/RequiredContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/RequiredContainerServices.java?rev=763145&view=auto
==============================================================================
--- portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/RequiredContainerServices.java (added)
+++ portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/RequiredContainerServices.java Wed Apr 8 08:53:16 2009
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.container.driver;
+
+import javax.portlet.PortalContext;
+
+import org.apache.pluto.container.EventCoordinationService;
+import org.apache.pluto.container.FilterManagerService;
+import org.apache.pluto.container.PortletRequestContextService;
+import org.apache.pluto.container.PortletURLListenerService;
+
+
+/**
+ * This interface defines the services required for integration between the
+ * Pluto Portlet Container and a Portal.
+ *
+ */
+public interface RequiredContainerServices {
+
+ /**
+ * Returns the PortalContext instance associated with this group of
+ * portlet container services.
+ * @return a PortalContext implementation.
+ */
+ PortalContext getPortalContext();
+
+ EventCoordinationService getEventCoordinationService();
+
+ /**
+ * Returns the portlet request context service implementation
+ * used by the container
+ */
+ PortletRequestContextService getPortletRequestContextService();
+
+ /**
+ * Returns the FilterManagerService
+ */
+ public FilterManagerService getFilterManagerService();
+
+ /**
+ * Returns the PortletURLListenerService
+ */
+ public PortletURLListenerService getPortletURLListenerService();
+}
Propchange: portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/RequiredContainerServices.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/RequiredContainerServices.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: portals/pluto/trunk/pluto-container-driver-api/src/main/java/org/apache/pluto/container/driver/RequiredContainerServices.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/AbstractPortletConfigImpl.java Wed Apr 8 08:53:16 2009
@@ -140,10 +140,7 @@
{
continue;
}
- else
- {
- qnameList.add(name);
- }
+ qnameList.add(name);
}
return Collections.enumeration(qnameList);
}
@@ -157,10 +154,7 @@
{
continue;
}
- else
- {
- qnameList.add(name);
- }
+ qnameList.add(name);
}
return Collections.enumeration(qnameList);
}
@@ -228,9 +222,6 @@
}
return Collections.unmodifiableMap(result);
}
- else
- {
- return Collections.emptyMap();
- }
+ return Collections.emptyMap();
}
}
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java Wed Apr 8 08:53:16 2009
@@ -351,10 +351,7 @@
{
return -1;
}
- else
- {
- return Integer.parseInt(property);
- }
+ return Integer.parseInt(property);
}
@Override
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerFactory.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerFactory.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerFactory.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerFactory.java Wed Apr 8 08:53:16 2009
@@ -18,10 +18,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.container.OptionalContainerServices;
+import org.apache.pluto.container.ContainerServices;
import org.apache.pluto.container.PortletContainer;
import org.apache.pluto.container.PortletContainerException;
-import org.apache.pluto.container.RequiredContainerServices;
import org.apache.pluto.container.util.ArgumentUtility;
/**
@@ -68,23 +67,13 @@
*/
public PortletContainer createContainer(
String containerName,
- RequiredContainerServices requiredServices)
- throws PortletContainerException {
- return createContainer(containerName,
- requiredServices,
- null);
- }
-
- public PortletContainer createContainer(
- String containerName,
- RequiredContainerServices requiredServices,
- OptionalContainerServices optionalServices) {
-
+ ContainerServices requiredServices)
+ throws PortletContainerException {
ArgumentUtility.validateNotNull("requiredServices", requiredServices);
ArgumentUtility.validateNotEmpty("containerName", containerName);
PortletContainer container = new PortletContainerImpl(
- containerName, requiredServices, optionalServices);
+ containerName, requiredServices);
if (LOG.isInfoEnabled()) {
LOG.info("Portlet Container [" + containerName + "] created.");
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java Wed Apr 8 08:53:16 2009
@@ -35,8 +35,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.container.ContainerServices;
import org.apache.pluto.container.FilterManager;
-import org.apache.pluto.container.OptionalContainerServices;
import org.apache.pluto.container.PortletActionResponseContext;
import org.apache.pluto.container.PortletContainer;
import org.apache.pluto.container.PortletContainerException;
@@ -50,7 +50,6 @@
import org.apache.pluto.container.PortletResourceRequestContext;
import org.apache.pluto.container.PortletResourceResponseContext;
import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.RequiredContainerServices;
/**
@@ -71,12 +70,8 @@
/** The portlet container name. */
private final String name;
- /** The required container services associated with this container. */
- private final RequiredContainerServices requiredContainerServices;
-
- /** The optional container services associated with this container. */
- private final OptionalContainerServices optionalContainerServices;
-
+ /** The container services associated with this container. */
+ private final ContainerServices containerServices;
/** Flag indicating whether or not we've been initialized. */
private boolean initialized = false;
@@ -89,14 +84,11 @@
*
* @param name the name of the container.
* @param requiredServices the required container services implementation.
- * @param optionalServices the optional container services implementation.
*/
public PortletContainerImpl(String name,
- RequiredContainerServices requiredServices,
- OptionalContainerServices optionalServices) {
+ ContainerServices requiredServices) {
this.name = name;
- this.requiredContainerServices = requiredServices;
- this.optionalContainerServices = optionalServices;
+ this.containerServices = requiredServices;
}
@@ -104,7 +96,6 @@
/**
* Initialize the container for use within the given configuration scope.
- * @param servletContext the servlet context of the portal webapp.
*/
public void init()
throws PortletContainerException {
@@ -151,9 +142,9 @@
debugWithName("Render request received for portlet: "
+ portletWindow.getPortletEntity().getPortletDefinition().getPortletName());
- PortletRequestContextService rcService = getRequiredContainerServices().getPortletRequestContextService();
- PortletEnvironmentService envService = getOptionalContainerServices().getPortletEnvironmentService();
- PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
+ PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
+ PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
+ PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
@@ -179,7 +170,7 @@
/**
* Indicates that a portlet resource Serving occured in the current request and calls
* the processServeResource method of this portlet.
- * @param PortletWindow the portlet Window
+ * @param portletWindow the portlet Window
* @param request the servlet request
* @param response the servlet response
* @throws PortletException if one portlet has trouble fulfilling
@@ -197,9 +188,9 @@
debugWithName("Resource request received for portlet: "
+ portletWindow.getPortletEntity().getPortletDefinition().getPortletName());
- PortletRequestContextService rcService = getRequiredContainerServices().getPortletRequestContextService();
- PortletEnvironmentService envService = getOptionalContainerServices().getPortletEnvironmentService();
- PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
+ PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
+ PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
+ PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
PortletResourceRequestContext requestContext = rcService.getPortletResourceRequestContext(this, request, response, portletWindow);
PortletResourceResponseContext responseContext = rcService.getPortletResourceResponseContext(this, request, response, portletWindow);
@@ -243,9 +234,9 @@
debugWithName("Action request received for portlet: "
+ portletWindow.getPortletEntity().getPortletDefinition().getPortletName());
- PortletRequestContextService rcService = getRequiredContainerServices().getPortletRequestContextService();
- PortletEnvironmentService envService = getOptionalContainerServices().getPortletEnvironmentService();
- PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
+ PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
+ PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
+ PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
PortletRequestContext requestContext = rcService.getPortletActionRequestContext(this, request, response, portletWindow);
PortletActionResponseContext responseContext = rcService.getPortletActionResponseContext(this, request, response, portletWindow);
@@ -271,7 +262,7 @@
List<Event> events = responseContext.getEvents();
if (!events.isEmpty())
{
- requiredContainerServices.getEventCoordinationService().processEvents(this, portletWindow, request, response, events);
+ getContainerServices().getEventCoordinationService().processEvents(this, portletWindow, request, response, events);
}
}
@@ -315,9 +306,9 @@
debugWithName("Load request received for portlet: "
+ portletWindow.getPortletEntity().getPortletDefinition().getPortletName());
- PortletRequestContextService rcService = getRequiredContainerServices().getPortletRequestContextService();
- PortletEnvironmentService envService = getOptionalContainerServices().getPortletEnvironmentService();
- PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
+ PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
+ PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
+ PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
@@ -349,9 +340,9 @@
debugWithName("Admin request received for portlet: "
+portletWindow.getPortletEntity().getPortletDefinition().getPortletName());
- PortletRequestContextService rcService = getRequiredContainerServices().getPortletRequestContextService();
- PortletEnvironmentService envService = getOptionalContainerServices().getPortletEnvironmentService();
- PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
+ PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
+ PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
+ PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
@@ -373,36 +364,31 @@
}
+ /**
+ * @see org.apache.pluto.container.PortletContainer#getName()
+ */
public String getName() {
return name;
}
- public RequiredContainerServices getRequiredContainerServices() {
- return requiredContainerServices;
- }
-
/**
- * Retrieve the optional container services used by the container.
- * If no implementation was provided during construction, the default
- * instance will be returned.
- *
- * @return services used by the container.
+ * @see org.apache.pluto.container.PortletContainer#getContainerServices()
*/
- public OptionalContainerServices getOptionalContainerServices() {
- return optionalContainerServices;
+ public ContainerServices getContainerServices() {
+ return containerServices;
}
-
+
/**
* Fire Event for the portlet associated with the given portlet window and eventName
* @param portletWindow the portlet window.
* @param request the servlet request.
* @param response the servlet response.
- * @param eventName the event name
+ * @param event the event
* @throws PortletException
* @throws IOException
* @throws PortletContainerException
*
- * @see {@link javax.portlet.EventPortlet#processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)
+ * @see javax.portlet.EventPortlet#processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)
*/
public void doEvent(PortletWindow portletWindow,
HttpServletRequest request,
@@ -415,9 +401,9 @@
debugWithName("Event: "+event.getName()+" received for portlet: "
+ portletWindow.getPortletEntity().getPortletDefinition().getPortletName());
- PortletRequestContextService rcService = getRequiredContainerServices().getPortletRequestContextService();
- PortletEnvironmentService envService = getOptionalContainerServices().getPortletEnvironmentService();
- PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
+ PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
+ PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
+ PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
PortletRequestContext requestContext = rcService.getPortletEventRequestContext(this, request, response, portletWindow);
PortletEventResponseContext responseContext = rcService.getPortletEventResponseContext(this, request, response, portletWindow);
@@ -445,7 +431,7 @@
if (events != null && !events.isEmpty())
{
- requiredContainerServices.getEventCoordinationService().processEvents(this, portletWindow, request, response, events);
+ getContainerServices().getEventCoordinationService().processEvents(this, portletWindow, request, response, events);
}
debugWithName("Portlet event: "+ event.getName() +" fired for: " + portletWindow.getPortletEntity().getPortletDefinition().getPortletName());
@@ -493,7 +479,7 @@
*/
private FilterManager filterInitialisation(PortletWindow portletWindow,String lifeCycle) throws PortletContainerException{
PortletEntity pe = portletWindow.getPortletEntity();
- return requiredContainerServices.getFilterManagerService().getFilterManager(pe.getPortletDefinition().getApplication(),pe.getPortletDefinition().getPortletName(),lifeCycle);
+ return getContainerServices().getFilterManagerService().getFilterManager(pe.getPortletDefinition().getApplication(),pe.getPortletDefinition().getPortletName(),lifeCycle);
}
}
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContextImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContextImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContextImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContextImpl.java Wed Apr 8 08:53:16 2009
@@ -62,7 +62,7 @@
/**
* Constructs an instance.
* @param servletContext the servlet context in which we are contained.
- * @param portletAppDD the portlet application descriptor.
+ * @param portletApp the portlet application descriptor.
*/
public PortletContextImpl(ServletContext servletContext,
PortletApplicationDefinition portletApp,
@@ -133,12 +133,11 @@
{
RequestDispatcherPathInfoProvider provider = RequestDispatcherPathInfoProviderImpl.getProvider(this, portletApp);
return new PortletRequestDispatcherImpl(dispatcher, provider.getNamedRequestDispatcherPathInfo());
- } else {
- if (LOG.isInfoEnabled()) {
- LOG.info("No matching request dispatcher found for name: "
- + name);
- }
}
+ if (LOG.isInfoEnabled()) {
+ LOG.info("No matching request dispatcher found for name: "
+ + name);
+ }
return null;
}
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletPreferencesImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletPreferencesImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletPreferencesImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletPreferencesImpl.java Wed Apr 8 08:53:16 2009
@@ -92,7 +92,7 @@
this.request = request;
// Get the portlet preferences service from container.
- preferencesService = container.getOptionalContainerServices()
+ preferencesService = container.getContainerServices()
.getPortletPreferencesService();
if (LOG.isDebugEnabled()) {
LOG.debug("Using PortletPreferencesService: "
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestDispatcherImpl.java Wed Apr 8 08:53:16 2009
@@ -183,10 +183,7 @@
{
throw new PortletException(sex.getRootCause());
}
- else
- {
- throw new PortletException(sex);
- }
+ throw new PortletException(sex);
}
finally
{
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestImpl.java Wed Apr 8 08:53:16 2009
@@ -42,7 +42,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.container.OptionalContainerServices;
+import org.apache.pluto.container.ContainerServices;
import org.apache.pluto.container.PortletContainer;
import org.apache.pluto.container.PortletEntity;
import org.apache.pluto.container.PortletEnvironmentService;
@@ -109,7 +109,7 @@
this.requestContext = requestContext;
this.responseContext = responseContext;
this.lifecyclePhase = lifecyclePhase;
- this.portalContext = getPortletContainer().getRequiredContainerServices().getPortalContext();
+ this.portalContext = getPortletContainer().getContainerServices().getPortalContext();
}
private void retrieveRequestProperties()
@@ -182,10 +182,7 @@
}
return Collections.unmodifiableMap(result);
}
- else
- {
- return Collections.emptyMap();
- }
+ return Collections.emptyMap();
}
protected Map<String, String[]> initParameterMap()
@@ -276,7 +273,7 @@
{
try
{
- userInfo = getPortletContainer().getOptionalContainerServices().getUserInfoService().getUserInfo(this, getPortletWindow());
+ userInfo = getPortletContainer().getContainerServices().getUserInfoService().getUserInfo(this, getPortletWindow());
}
catch (Exception e)
{
@@ -297,7 +294,7 @@
{
if (ccppProfile == null)
{
- ccppProfile = getPortletContainer().getOptionalContainerServices().getCCPPProfileService().getCCPPProfile(getServletRequest());
+ ccppProfile = getPortletContainer().getContainerServices().getCCPPProfileService().getCCPPProfile(getServletRequest());
}
return ccppProfile;
}
@@ -483,8 +480,8 @@
{
LOG.debug("Creating new portlet session...");
}
- final OptionalContainerServices optionalContainerServices = getPortletContainer().getOptionalContainerServices();
- final PortletEnvironmentService portletEnvironmentService = optionalContainerServices.getPortletEnvironmentService();
+ final ContainerServices containerServices = getPortletContainer().getContainerServices();
+ final PortletEnvironmentService portletEnvironmentService = containerServices.getPortletEnvironmentService();
portletSession = portletEnvironmentService.createPortletSession(getPortletContext(), getPortletWindow(), httpSession);
}
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletResponseImpl.java Wed Apr 8 08:53:16 2009
@@ -24,12 +24,6 @@
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.pluto.container.PortletContainer;
import org.apache.pluto.container.PortletResponseContext;
import org.apache.pluto.container.PortletWindow;
@@ -37,7 +31,6 @@
import org.apache.pluto.container.om.portlet.Supports;
import org.apache.pluto.container.util.ArgumentUtility;
import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
@@ -46,9 +39,6 @@
public abstract class PortletResponseImpl implements PortletResponse
{
- /** Logger. */
- private static final Log LOG = LogFactory.getLog(PortletResponseImpl.class);
-
private String namespace;
private PortletResponseContext responseContext;
@@ -75,7 +65,7 @@
protected PortalContext getPortalContext()
{
- return getPortletContainer().getRequiredContainerServices().getPortalContext();
+ return getPortletContainer().getContainerServices().getPortalContext();
}
protected HttpServletRequest getServletRequest()
@@ -175,7 +165,7 @@
{
if (namespace == null)
{
- namespace = getPortletContainer().getOptionalContainerServices().getNamespaceMapper().encode(getPortletWindow().getId(), "");
+ namespace = getPortletContainer().getContainerServices().getNamespaceMapper().encode(getPortletWindow().getId(), "");
StringBuffer validNamespace = new StringBuffer();
for (int i = 0; i < namespace.length(); i++)
{
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletSessionImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletSessionImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletSessionImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletSessionImpl.java Wed Apr 8 08:53:16 2009
@@ -244,9 +244,7 @@
return (id.equals(portletWindow.getId().getStringId()));
}
// Application-scoped attribute names are not in portlet scope.
- else {
- return false;
- }
+ return false;
}
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletURLImpl.java Wed Apr 8 08:53:16 2009
@@ -62,7 +62,7 @@
public PortletURLImpl(PortletResponseContext responseContext, PortletURLProvider urlProvider)
{
this.responseContext = responseContext;
- this.portalContext = responseContext.getContainer().getRequiredContainerServices().getPortalContext();
+ this.portalContext = responseContext.getContainer().getContainerServices().getPortalContext();
this.urlProvider = urlProvider;
renderURL = PortletURLProvider.TYPE.RENDER == urlProvider.getType();
}
@@ -183,7 +183,7 @@
filtering = true;
try
{
- PortletURLListenerService service = responseContext.getContainer().getRequiredContainerServices().getPortletURLListenerService();
+ PortletURLListenerService service = responseContext.getContainer().getContainerServices().getPortletURLListenerService();
PortletApplicationDefinition portletApp = responseContext.getPortletWindow().getPortletEntity().getPortletDefinition().getApplication();
for (PortletURLGenerationListener listener : service.getPortletURLGenerationListeners(portletApp))
{
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/util/StringManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/util/StringManager.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/util/StringManager.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/container/util/StringManager.java Wed Apr 8 08:53:16 2009
@@ -16,7 +16,6 @@
*/
package org.apache.pluto.container.util;
-import java.net.URLClassLoader;
import java.text.MessageFormat;
import java.util.Hashtable;
import java.util.Locale;
Modified: portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/container/impl/PortletRequestImplTest.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/container/impl/PortletRequestImplTest.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/container/impl/PortletRequestImplTest.java (original)
+++ portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/container/impl/PortletRequestImplTest.java Wed Apr 8 08:53:16 2009
@@ -24,13 +24,12 @@
import javax.servlet.http.HttpSession;
import org.apache.pluto.container.CCPPProfileService;
-import org.apache.pluto.container.OptionalContainerServices;
+import org.apache.pluto.container.ContainerServices;
import org.apache.pluto.container.PortletEnvironmentService;
import org.apache.pluto.container.PortletRenderResponseContext;
import org.apache.pluto.container.PortletRequestContext;
import org.apache.pluto.container.PortletURLProvider;
import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.RequiredContainerServices;
import org.apache.pluto.container.impl.PortletContainerImpl;
import org.apache.pluto.container.impl.RenderRequestImpl;
import org.jmock.Mock;
@@ -46,18 +45,17 @@
public class PortletRequestImplTest extends MockObjectTestCase
{
// Mock Objects
- private Mock mockContainer = null;
- private Mock mockServices = null;
- private Mock mockCCPPProfileService = null;
- private Mock mockOptionalServices = null;
- private Mock mockPortalContext = null;
- private Mock mockPortletContext = null;
- private Mock mockHttpServletRequest = null;
- private Mock mockPortletURLProvider = null;
- private Mock mockPortletRequestContext = null;
- private Mock mockPortletResponseContext = null;
- private Mock mockCacheControl = null;
- private PortletWindow window = null;
+ private Mock mockContainer;
+ private Mock mockServices;
+ private Mock mockCCPPProfileService;
+ private Mock mockPortalContext;
+ private Mock mockPortletContext;
+ private Mock mockHttpServletRequest;
+ private Mock mockPortletURLProvider;
+ private Mock mockPortletRequestContext;
+ private Mock mockPortletResponseContext;
+ private Mock mockCacheControl;
+ private PortletWindow window;
/* (non-Javadoc)
@@ -68,15 +66,14 @@
super.setUp();
// Create mocks
- mockServices = mock( RequiredContainerServices.class );
+ mockServices = mock( ContainerServices.class );
mockCCPPProfileService = mock( CCPPProfileService.class );
- mockOptionalServices = mock( OptionalContainerServices.class );
mockPortalContext = mock( PortalContext.class );
mockPortletContext = mock( PortletContext.class );
mockPortletURLProvider = mock(PortletURLProvider.class);
mockContainer = mock( PortletContainerImpl.class,
- new Class[] { String.class, RequiredContainerServices.class, OptionalContainerServices.class },
- new Object[] { "Mock Pluto Container", (RequiredContainerServices) mockServices.proxy(), (OptionalContainerServices) mockOptionalServices.proxy() } );
+ new Class[] { String.class, ContainerServices.class },
+ new Object[] { "Mock Pluto Container", (ContainerServices) mockServices.proxy() } );
window = (PortletWindow) mock( PortletWindow.class ).proxy();
mockHttpServletRequest = mock( HttpServletRequest.class );
mockPortletRequestContext = mock ( PortletRequestContext.class );
@@ -107,14 +104,14 @@
Mock mockPortletEnvironmentService = mock( PortletEnvironmentService.class );
- mockOptionalServices.expects( once() ).method( "getPortletEnvironmentService" ).will( returnValue( mockPortletEnvironmentService.proxy() ));
+ mockServices.expects( once() ).method( "getPortletEnvironmentService" ).will( returnValue( mockPortletEnvironmentService.proxy() ));
mockCCPPProfileService.expects(once()).method("getCCPPProfile").will(returnValue( null ));
- mockOptionalServices.expects(once()).method("getCCPPProfileService").will(returnValue( mockCCPPProfileService.proxy() ));
+ mockServices.expects(once()).method("getCCPPProfileService").will(returnValue( mockCCPPProfileService.proxy() ));
mockContainer.expects(once()).method("getRequiredContainerServices").will(returnValue( mockServices.proxy() ));
- mockContainer.expects(atLeastOnce()).method("getOptionalContainerServices").will(returnValue( mockOptionalServices.proxy() ));
+ mockContainer.expects(atLeastOnce()).method("getOptionalContainerServices").will(returnValue( mockServices.proxy() ));
mockPortletRequestContext.expects(atLeastOnce()).method("getContainer").will(returnValue( mockContainer.proxy()));
// Create the render request that is under test, and initialize its state
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletRequestContextImpl.java Wed Apr 8 08:53:16 2009
@@ -77,7 +77,7 @@
{
return name;
}
- return container.getOptionalContainerServices().getNamespaceMapper().encode(window.getId(), name);
+ return container.getContainerServices().getNamespaceMapper().encode(window.getId(), name);
}
protected String decodeAttributeName(String name)
@@ -86,7 +86,7 @@
{
return name;
}
- String result = container.getOptionalContainerServices().getNamespaceMapper().decode(window.getId(), name);
+ String result = container.getContainerServices().getNamespaceMapper().decode(window.getId(), name);
return result != null ? result : name;
}
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java Wed Apr 8 08:53:16 2009
@@ -22,14 +22,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.container.OptionalContainerServices;
import org.apache.pluto.container.PortletContainer;
import org.apache.pluto.container.PortletContainerException;
-import org.apache.pluto.container.RequiredContainerServices;
+import org.apache.pluto.container.driver.OptionalContainerServices;
+import org.apache.pluto.container.driver.RequiredContainerServices;
import org.apache.pluto.container.impl.PortletContainerFactory;
import org.apache.pluto.driver.config.AdminConfiguration;
import org.apache.pluto.driver.config.DriverConfiguration;
import org.apache.pluto.driver.config.DriverConfigurationException;
+import org.apache.pluto.driver.container.PortalDriverServicesImpl;
import org.springframework.web.context.WebApplicationContext;
/**
@@ -179,13 +180,13 @@
OptionalContainerServices optional =
(OptionalContainerServices) springContext.getBean("OptionalContainerServices");
-
+
// Create portlet container.
LOG.debug(" [3] Creating portlet container...");
PortletContainerFactory factory =
PortletContainerFactory.getInstance();
PortletContainer container = factory.createContainer(
- driverConfig.getContainerName(), required, optional
+ driverConfig.getContainerName(), new PortalDriverServicesImpl(required, optional)
);
// Initialize portlet container.
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultOptionalContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultOptionalContainerServices.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultOptionalContainerServices.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DefaultOptionalContainerServices.java Wed Apr 8 08:53:16 2009
@@ -18,12 +18,12 @@
import org.apache.pluto.container.CCPPProfileService;
import org.apache.pluto.container.NamespaceMapper;
-import org.apache.pluto.container.OptionalContainerServices;
import org.apache.pluto.container.PortletAppDescriptorService;
import org.apache.pluto.container.PortletEnvironmentService;
import org.apache.pluto.container.PortletInvokerService;
import org.apache.pluto.container.PortletPreferencesService;
import org.apache.pluto.container.UserInfoService;
+import org.apache.pluto.container.driver.OptionalContainerServices;
import org.apache.pluto.container.driver.PortalAdministrationService;
import org.apache.pluto.container.driver.PortalDriverContainerServices;
import org.apache.pluto.container.driver.PortletContextService;
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortalDriverServicesImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortalDriverServicesImpl.java?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortalDriverServicesImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/PortalDriverServicesImpl.java Wed Apr 8 08:53:16 2009
@@ -22,19 +22,18 @@
import org.apache.pluto.container.EventCoordinationService;
import org.apache.pluto.container.FilterManagerService;
import org.apache.pluto.container.NamespaceMapper;
-import org.apache.pluto.container.OptionalContainerServices;
import org.apache.pluto.container.PortletEnvironmentService;
import org.apache.pluto.container.PortletInvokerService;
import org.apache.pluto.container.PortletPreferencesService;
import org.apache.pluto.container.PortletRequestContextService;
import org.apache.pluto.container.PortletURLListenerService;
-import org.apache.pluto.container.RequiredContainerServices;
import org.apache.pluto.container.UserInfoService;
+import org.apache.pluto.container.driver.OptionalContainerServices;
import org.apache.pluto.container.driver.PortalAdministrationService;
-import org.apache.pluto.container.driver.PortalDriverContainerServices;
import org.apache.pluto.container.driver.PortalDriverServices;
import org.apache.pluto.container.driver.PortletContextService;
import org.apache.pluto.container.driver.PortletRegistryService;
+import org.apache.pluto.container.driver.RequiredContainerServices;
import org.apache.pluto.container.impl.PortletEnvironmentServiceImpl;
@@ -65,22 +64,54 @@
private PortletContextService portletContextService;
private PortletRegistryService portletRegistryService;
private PortalAdministrationService portalAdministrationService;
-
+
+ /**
+ * Constructor for just passing in the required services.
+ * @param context
+ * @param portletRequestContextService
+ * @param eventCoordinationService
+ * @param filterManagerService
+ * @param portletURLListenerService
+ */
public PortalDriverServicesImpl(PortalContext context,
- PortletRequestContextService portletRequestContextService,
- EventCoordinationService eventCoordinationService,
- FilterManagerService filterManagerService,
- PortletURLListenerService portletURLListenerService)
+ PortletRequestContextService portletRequestContextService,
+ EventCoordinationService eventCoordinationService,
+ FilterManagerService filterManagerService,
+ PortletURLListenerService portletURLListenerService)
{
- this.context = context;
- this.eventCoordinationService = eventCoordinationService;
- this.portletRequestContextService = portletRequestContextService;
- this.filterManagerService = filterManagerService;
- this.portletURLListenerService = portletURLListenerService;
+ this(context, portletRequestContextService, eventCoordinationService,
+ filterManagerService, portletURLListenerService, null);
+ }
- createDefaultServicesIfNeeded();
- }
-
+ /**
+ * Constructor for passing in the required services and optional container services.
+ * @param context
+ * @param portletRequestContextService
+ * @param eventCoordinationService
+ * @param filterManagerService
+ * @param portletURLListenerService
+ * @param optionalServices Optional services (if this is null, default services are used)
+ */
+ public PortalDriverServicesImpl(PortalContext context,
+ PortletRequestContextService portletRequestContextService,
+ EventCoordinationService eventCoordinationService,
+ FilterManagerService filterManagerService,
+ PortletURLListenerService portletURLListenerService,
+ OptionalContainerServices optionalServices)
+ {
+ this(context, portletRequestContextService, eventCoordinationService,
+ filterManagerService, portletURLListenerService, optionalServices, null, null, null);
+ }
+
+ /**
+ * Constructor for passing in the required services and optional container services.
+ * @param context
+ * @param portletRequestContextService
+ * @param eventCoordinationService
+ * @param filterManagerService
+ * @param portletURLListenerService
+ * @param optionalServices Optional services (if this is null, default services are used)
+ */
public PortalDriverServicesImpl(PortalContext context,
PortletRequestContextService portletRequestContextService,
EventCoordinationService eventCoordinationService,
@@ -90,41 +121,41 @@
PortletContextService portletContextService,
PortletRegistryService portletRegistryService,
PortalAdministrationService portalAdministrationService)
- {
+ {
+ // set required first
this.context = context;
this.eventCoordinationService = eventCoordinationService;
this.portletRequestContextService = portletRequestContextService;
this.filterManagerService = filterManagerService;
this.portletURLListenerService = portletURLListenerService;
- portletEnvironmentService = optionalServices.getPortletEnvironmentService();
- ccppProfileService = optionalServices.getCCPPProfileService();
- portletPreferencesService = optionalServices.getPortletPreferencesService();
- portletInvokerService = optionalServices.getPortletInvokerService();
- userInfoService = optionalServices.getUserInfoService();
- namespaceMapper = optionalServices.getNamespaceMapper();
-
+ // now optional
+ if ( optionalServices != null ) {
+ ccppProfileService = optionalServices.getCCPPProfileService();
+ portletPreferencesService = optionalServices.getPortletPreferencesService();
+ portletInvokerService = optionalServices.getPortletInvokerService();
+ portletEnvironmentService = optionalServices.getPortletEnvironmentService();
+ userInfoService = optionalServices.getUserInfoService();
+ namespaceMapper = optionalServices.getNamespaceMapper();
+ }
+
+ // and finally driver
this.portletContextService = portletContextService;
- this.portletRegistryService = portletRegistryService;
+ this.portletRegistryService = portletRegistryService;
this.portalAdministrationService = portalAdministrationService;
createDefaultServicesIfNeeded();
}
- public PortalDriverServicesImpl(RequiredContainerServices required, OptionalContainerServices optional)
- {
- this(required.getPortalContext(), required.getPortletRequestContextService(),
- required.getEventCoordinationService(), required.getFilterManagerService(),
- required.getPortletURLListenerService(), optional, null, null, null);
- }
-
- public PortalDriverServicesImpl(RequiredContainerServices required, OptionalContainerServices optional, PortalDriverContainerServices driver)
- {
+ /**
+ * Constructor
+ * @param required
+ * @param optional Optional services (if this is null, default services are used)
+ */
+ public PortalDriverServicesImpl(RequiredContainerServices required, OptionalContainerServices optional) {
this(required.getPortalContext(), required.getPortletRequestContextService(),
required.getEventCoordinationService(), required.getFilterManagerService(),
- required.getPortletURLListenerService(), optional,
- driver.getPortletContextService(), driver.getPortletRegistryService(),
- driver.getPortalAdministrationService());
+ required.getPortletURLListenerService(), optional);
}
protected void createDefaultServicesIfNeeded()
@@ -140,6 +171,9 @@
namespaceMapper = namespaceMapper == null ? new DefaultNamespaceMapper() : namespaceMapper;
}
+ /**
+ * @see org.apache.pluto.container.ContainerServices#getPortalContext()
+ */
public PortalContext getPortalContext()
{
return context;
@@ -157,7 +191,6 @@
/**
* Returns null to use pluto's default
- * @return
*/
public PortletRegistryService getPortletRegistryService()
{
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?rev=763145&r1=763144&r2=763145&view=diff
==============================================================================
--- 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 Wed Apr 8 08:53:16 2009
@@ -52,7 +52,7 @@
<bean id="RequiredContainerServices"
name="OptionalContainerServices"
- class="org.apache.pluto.container.driver.impl.PortalDriverServicesImpl"
+ class="org.apache.pluto.driver.container.PortalDriverServicesImpl"
singleton="true">
<constructor-arg><ref bean="PortalContext"/></constructor-arg>
<constructor-arg><ref bean="PortletRequestContextService"/></constructor-arg>