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 ms...@apache.org on 2014/11/25 13:50:08 UTC
[03/19] portals-pluto git commit: First steps towards implementing
Ajax Action on server
First steps towards implementing Ajax Action on server
Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/c86384d8
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/c86384d8
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/c86384d8
Branch: refs/heads/PortletHub
Commit: c86384d89015158add09c8de1b61a8dc83bac784
Parents: 909e237
Author: Scott Nicklous <ms...@apache.org>
Authored: Thu Nov 20 11:43:16 2014 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Thu Nov 20 11:43:16 2014 +0100
----------------------------------------------------------------------
.../pluto/container/PortletContainer.java | 366 +++---
.../container/impl/PortletContainerImpl.java | 976 +++++++--------
.../driver/url/impl/PortalURLParserImpl.java | 1122 +++++++++---------
.../driver/url/impl/RelativePortalURLImpl.java | 770 ++++++------
.../apache/pluto/driver/PortalDriverFilter.java | 380 +++---
.../pluto/driver/PortalDriverServlet.java | 416 +++----
.../org/apache/pluto/driver/url/PortalURL.java | 212 ++--
7 files changed, 2148 insertions(+), 2094 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/c86384d8/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
----------------------------------------------------------------------
diff --git a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
index 6aa49ff..a0bdfc6 100644
--- a/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
+++ b/pluto-container-api/src/main/java/org/apache/pluto/container/PortletContainer.java
@@ -1,181 +1,185 @@
-/*
- * 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;
-
-import java.io.IOException;
-
-import javax.portlet.Event;
-import javax.portlet.PortletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * The publicized entry point into Pluto. The base functionality of the portlet
- * container can be enhanced or even modified by PortletContainerServices.
- * <p/>
- * <P> The methods of this class have to be called in the following order:
- * <TABLE> <TR><TH>Method</TH><TH>Description</TH><TH>Constraints</TH></TR>
- * <TR><TD>{@link #init()}</TD> <TD>Initialized the
- * portlet container.</TD> <TD>Performed only once per container
- * lifecycle.</TD></TR>
- * <p/>
- * <TR><TD>{@link #doAction(PortletWindow,
- * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}</TD>
- * <TD>Perform the action for the targeted portlet</TD> <TD>Optionally performed
- * for a single portlet per request</TD></TR>
- * <p/>
- * <TR><TD>{@link #doRender(PortletWindow,
- * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}</TD>
- * <TD>Render the portlet</TD> <TD>Performed once for each portlet per
- * request.</TD></TR>
- * <p/>
- * <TR><TD>{@link #destroy()}</TD> <TD>Destroy and remove container from
- * service.</TD> <TD>Performed only once per container lifecylce</TD></TR>
- */
-public interface PortletContainer {
-
- /**
- * Initializes the container
- * @throws PortletContainerException if an error occurs.
- */
- void init() throws PortletContainerException;
-
- /**
- * Shuts down the container. After calling this method it is no longer valid
- * to call any method on the portlet container.
- * @throws PortletContainerException if an error occurs while shutting down
- * the container
- */
- void destroy() throws PortletContainerException;
-
- /**
- * Calls the render method of the given 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
- * the request
- * @throws IOException if the streaming causes an I/O problem
- * @throws PortletContainerException if the portlet container implementation
- * has trouble fulfilling the request
- */
- void doRender(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException;
-
- /**
- * 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 request the servlet request
- * @param response the servlet response
- * @throws PortletException if one portlet has trouble fulfilling
- * the request
- * @throws PortletContainerException if the portlet container implementation
- * has trouble fulfilling the request
- */
- void doServeResource(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException;
-
- /**
- * Indicates that a portlet action occured in the current request and calls
- * the processAction method of this portlet.
- * @param portletWindow the portlet Window
- * @param request the servlet request
- * @param response the servlet response
- * @throws PortletException if one portlet has trouble fulfilling
- * the request
- * @throws PortletContainerException if the portlet container implementation
- * has trouble fulfilling the request
- */
- void doAction(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException;
-
- /**
- * Indicates that the portlet must be initialized
- * @param portletWindow the portlet Window
- * @param servletRequest the servlet request
- * @param servletResponse the servlet response
- * @throws PortletException if one portlet has trouble fulfilling
- * the request
- * @throws PortletContainerException if the portlet container implementation
- * has trouble fulfilling the request
- */
- void doLoad(PortletWindow portletWindow,
- HttpServletRequest servletRequest,
- HttpServletResponse servletResponse)
- throws PortletException, IOException, PortletContainerException;
-
- /**
- * Indicates that the portal needs to perform administrative
- * actions upon the portlet and/or portlet application. An
- * administrative request will be spawned and any registered
- * handlers invoked.
- * @param portletWindow the portlet window
- * @param servletRequest the servlet request
- * @param servletResponse the servlet response
- * @throws PortletException if one portlet has trouble fulfilling
- * the request
- * @throws PortletContainerException if the portlet container implementation
- * has trouble fulfilling the request
- */
- void doAdmin(PortletWindow portletWindow,
- HttpServletRequest servletRequest,
- HttpServletResponse servletResponse)
- throws PortletException, IOException, PortletContainerException;
-
- /**
- * Indicates that an event should be fired in the current request and calls
- * the processEvent method of this portlet.
- * @param portletWindow the portlet Window
- * @param request the servlet request
- * @param response the servlet response
- * @param event The event.
- * @throws PortletException if one portlet has trouble fulfilling
- * the request
- * @throws PortletContainerException if the portlet container implementation
- * has trouble fulfilling the request
- */
- public void doEvent(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response,
- Event event)
- throws PortletException, IOException, PortletContainerException;
-
- /**
- * Returns whether the container is already initialized or not.
- * @return <code>true</code> if the container is initialized
- */
- boolean isInitialized();
-
- /**
- * Retrieve the unique container name
- * @return the container name.
- */
- String getName();
-
- /**
- * Retreive the container services associated with this container.
- * @return the container services associated with this container.
- */
- ContainerServices getContainerServices();
-}
+/*
+ * 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;
+
+import java.io.IOException;
+
+import javax.portlet.Event;
+import javax.portlet.PortletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * The publicized entry point into Pluto. The base functionality of the portlet
+ * container can be enhanced or even modified by PortletContainerServices.
+ * <p/>
+ * <P> The methods of this class have to be called in the following order:
+ * <TABLE> <TR><TH>Method</TH><TH>Description</TH><TH>Constraints</TH></TR>
+ * <TR><TD>{@link #init()}</TD> <TD>Initialized the
+ * portlet container.</TD> <TD>Performed only once per container
+ * lifecycle.</TD></TR>
+ * <p/>
+ * <TR><TD>{@link #doAction(PortletWindow,
+ * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}</TD>
+ * <TD>Perform the action for the targeted portlet</TD> <TD>Optionally performed
+ * for a single portlet per request</TD></TR>
+ * <p/>
+ * <TR><TD>{@link #doRender(PortletWindow,
+ * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}</TD>
+ * <TD>Render the portlet</TD> <TD>Performed once for each portlet per
+ * request.</TD></TR>
+ * <p/>
+ * <TR><TD>{@link #destroy()}</TD> <TD>Destroy and remove container from
+ * service.</TD> <TD>Performed only once per container lifecylce</TD></TR>
+ */
+public interface PortletContainer {
+
+ /**
+ * Initializes the container
+ * @throws PortletContainerException if an error occurs.
+ */
+ void init() throws PortletContainerException;
+
+ /**
+ * Shuts down the container. After calling this method it is no longer valid
+ * to call any method on the portlet container.
+ * @throws PortletContainerException if an error occurs while shutting down
+ * the container
+ */
+ void destroy() throws PortletContainerException;
+
+ /**
+ * Calls the render method of the given 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
+ * the request
+ * @throws IOException if the streaming causes an I/O problem
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ void doRender(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws PortletException, IOException, PortletContainerException;
+
+ /**
+ * 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 request the servlet request
+ * @param response the servlet response
+ * @throws PortletException if one portlet has trouble fulfilling
+ * the request
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ void doServeResource(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws PortletException, IOException, PortletContainerException;
+
+ /**
+ * Indicates that a portlet action occured in the current request and calls
+ * the processAction method of this portlet.
+ * @param portletWindow the portlet Window
+ * @param request the servlet request
+ * @param response the servlet response
+ * @param isRedirect Flag indicating whether redirect is to be performed.
+ * should be true for Action request and false for Ajax Action or
+ * Partial Action requests.
+ * @throws PortletException if one portlet has trouble fulfilling
+ * the request
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ void doAction(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ boolean isRedirect)
+ throws PortletException, IOException, PortletContainerException;
+
+ /**
+ * Indicates that the portlet must be initialized
+ * @param portletWindow the portlet Window
+ * @param servletRequest the servlet request
+ * @param servletResponse the servlet response
+ * @throws PortletException if one portlet has trouble fulfilling
+ * the request
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ void doLoad(PortletWindow portletWindow,
+ HttpServletRequest servletRequest,
+ HttpServletResponse servletResponse)
+ throws PortletException, IOException, PortletContainerException;
+
+ /**
+ * Indicates that the portal needs to perform administrative
+ * actions upon the portlet and/or portlet application. An
+ * administrative request will be spawned and any registered
+ * handlers invoked.
+ * @param portletWindow the portlet window
+ * @param servletRequest the servlet request
+ * @param servletResponse the servlet response
+ * @throws PortletException if one portlet has trouble fulfilling
+ * the request
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ void doAdmin(PortletWindow portletWindow,
+ HttpServletRequest servletRequest,
+ HttpServletResponse servletResponse)
+ throws PortletException, IOException, PortletContainerException;
+
+ /**
+ * Indicates that an event should be fired in the current request and calls
+ * the processEvent method of this portlet.
+ * @param portletWindow the portlet Window
+ * @param request the servlet request
+ * @param response the servlet response
+ * @param event The event.
+ * @throws PortletException if one portlet has trouble fulfilling
+ * the request
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ public void doEvent(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ Event event)
+ throws PortletException, IOException, PortletContainerException;
+
+ /**
+ * Returns whether the container is already initialized or not.
+ * @return <code>true</code> if the container is initialized
+ */
+ boolean isInitialized();
+
+ /**
+ * Retrieve the unique container name
+ * @return the container name.
+ */
+ String getName();
+
+ /**
+ * Retreive the container services associated with this container.
+ * @return the container services associated with this container.
+ */
+ ContainerServices getContainerServices();
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/c86384d8/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
index 25b99f0..ac8bf7e 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/PortletContainerImpl.java
@@ -1,483 +1,493 @@
-/*
- * 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.impl;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Event;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.pluto.container.ContainerServices;
-import org.apache.pluto.container.FilterManager;
-import org.apache.pluto.container.PortletActionResponseContext;
-import org.apache.pluto.container.PortletContainer;
-import org.apache.pluto.container.PortletContainerException;
-import org.apache.pluto.container.PortletEnvironmentService;
-import org.apache.pluto.container.PortletEventResponseContext;
-import org.apache.pluto.container.PortletInvokerService;
-import org.apache.pluto.container.PortletRenderResponseContext;
-import org.apache.pluto.container.PortletRequestContext;
-import org.apache.pluto.container.PortletRequestContextService;
-import org.apache.pluto.container.PortletResourceRequestContext;
-import org.apache.pluto.container.PortletResourceResponseContext;
-import org.apache.pluto.container.PortletWindow;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Default Pluto Container implementation.
- *
- * @version 1.0
- * @since Sep 18, 2004
- */
-public class PortletContainerImpl implements PortletContainer
-{
-
- /** Internal logger. */
- private static final Logger LOG = LoggerFactory.getLogger(PortletContainerImpl.class);
-
-
- // Private Member Variables ------------------------------------------------
-
- /** The portlet container name. */
- private final String name;
-
- /** The container services associated with this container. */
- private final ContainerServices containerServices;
-
- /** Flag indicating whether or not we've been initialized. */
- private boolean initialized = false;
-
-
- // Constructor -------------------------------------------------------------
-
- /** Default Constructor. Create a container implementation
- * whith the given name and given services.
- *
- * @param name the name of the container.
- * @param requiredServices the required container services implementation.
- */
- public PortletContainerImpl(String name,
- ContainerServices requiredServices) {
- this.name = name;
- this.containerServices = requiredServices;
- }
-
-
- // PortletContainer Impl ---------------------------------------------------
-
- /**
- * Initialize the container for use within the given configuration scope.
- */
- public void init()
- throws PortletContainerException {
- this.initialized = true;
- infoWithName("Container initialized successfully.");
- }
-
- /**
- * Determine whether this container has been initialized or not.
- * @return true if the container has been initialized.
- */
- public boolean isInitialized() {
- return initialized;
- }
-
- /**
- * Destroy this container.
- */
- public void destroy() {
- this.initialized = false;
- infoWithName("Container destroyed.");
- }
-
-
- /**
- * Renders the portlet associated with the specified portlet window.
- * @param portletWindow the portlet window.
- * @param request the servlet request.
- * @param response the servlet response.
- * @throws IllegalStateException if the container is not initialized.
- * @throws PortletException
- * @throws IOException
- * @throws PortletContainerException
- *
- * @see javax.portlet.Portlet#render(RenderRequest, RenderResponse)
- */
- public void doRender(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException
- {
- ensureInitialized();
-
- debugWithName("Render request received for portlet: "
- + portletWindow.getPortletDefinition().getPortletName());
-
- 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);
- RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
- RenderResponse portletResponse = envService.createRenderResponse(responseContext);
-
- FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RENDER_PHASE);
-
- try
- {
- invoker.render(requestContext, portletRequest, portletResponse, filterManager);
- // Mark portlet interaction is completed: backend implementation can flush response state now
- responseContext.close();
- }
- finally
- {
- responseContext.release();
- }
-
- debugWithName("Portlet render done for: " + portletWindow.getPortletDefinition().getPortletName());
- }
-
- /**
- * 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 request the servlet request
- * @param response the servlet response
- * @throws PortletException if one portlet has trouble fulfilling
- * the request
- * @throws PortletContainerException if the portlet container implementation
- * has trouble fulfilling the request
- */
- public void doServeResource(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException
- {
- ensureInitialized();
-
- debugWithName("Resource request received for portlet: "
- + portletWindow.getPortletDefinition().getPortletName());
-
- 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);
- ResourceRequest portletRequest = envService.createResourceRequest(requestContext, responseContext);
- ResourceResponse portletResponse = envService.createResourceResponse(responseContext, requestContext.getCacheability());
-
- FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RESOURCE_PHASE);
-
- try
- {
- invoker.serveResource(requestContext, portletRequest, portletResponse, filterManager);
- // Mark portlet interaction is completed: backend implementation can flush response state now
- responseContext.close();
- }
- finally
- {
- responseContext.release();
- }
-
- debugWithName("Portlet resource done for: " + portletWindow.getPortletDefinition().getPortletName());
- }
-
- /**
- * Process action for the portlet associated with the given portlet window.
- * @param portletWindow the portlet window.
- * @param request the servlet request.
- * @param response the servlet response.
- * @throws PortletException
- * @throws IOException
- * @throws PortletContainerException
- *
- * @see javax.portlet.Portlet#processAction(ActionRequest, ActionResponse)
- */
- public void doAction(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException
- {
- ensureInitialized();
-
- debugWithName("Action request received for portlet: "
- + portletWindow.getPortletDefinition().getPortletName());
-
- 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);
- ActionRequest portletRequest = envService.createActionRequest(requestContext, responseContext);
- ActionResponse portletResponse = envService.createActionResponse(responseContext);
-
- FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.ACTION_PHASE);
-
- String location = null;
-
- try
- {
- invoker.action(requestContext, portletRequest, portletResponse, filterManager);
-
- debugWithName("Portlet action processed for: "
- + portletWindow.getPortletDefinition().getPortletName());
-
- // Mark portlet interaction is completed: backend implementation can flush response state now
- responseContext.close();
-
- if (!responseContext.isRedirect())
- {
- List<Event> events = responseContext.getEvents();
- if (!events.isEmpty())
- {
- getContainerServices().getEventCoordinationService().processEvents(this, portletWindow, request, response, events);
- }
- }
-
- // After processing action and possible event handling, retrieve the target response URL to be redirected to
- // This can either be a renderURL or an external URL (optionally containing a future renderURL as query parameter
- location = response.encodeRedirectURL(responseContext.getResponseURL());
- }
- finally
- {
- responseContext.release();
- }
- redirect(request, response, location);
-
- debugWithName("Portlet action done for: " + portletWindow.getPortletDefinition().getPortletName());
- }
-
- protected void redirect(HttpServletRequest request, HttpServletResponse response, String location) throws IOException
- {
- // Here we intentionally use the original response
- // instead of the wrapped internal response.
- response.sendRedirect(location);
- debugWithName("Redirect URL sent.");
- }
-
- /**
- * Loads the portlet associated with the specified portlet window.
- * @param portletWindow the portlet window.
- * @param request the servlet request.
- * @param response the servlet response.
- * @throws PortletException
- * @throws IOException
- * @throws PortletContainerException
- */
- public void doLoad(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException
- {
- ensureInitialized();
-
- debugWithName("Load request received for portlet: "
- + portletWindow.getPortletDefinition().getPortletName());
-
- 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);
- RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
- RenderResponse portletResponse = envService.createRenderResponse(responseContext);
-
- try
- {
- invoker.load(requestContext, portletRequest, portletResponse);
- // Mark portlet interaction is completed: backend implementation can flush response state now
- responseContext.close();
- }
- finally
- {
- responseContext.release();
- }
-
- debugWithName("Portlet load done for: " + portletWindow.getPortletDefinition().getPortletName());
- }
-
-
- public void doAdmin(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException
- {
- ensureInitialized();
-
- debugWithName("Admin request received for portlet: "
- +portletWindow.getPortletDefinition().getPortletName());
-
- 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);
- RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
- RenderResponse portletResponse = envService.createRenderResponse(responseContext);
-
- try
- {
- invoker.admin(requestContext, portletRequest, portletResponse);
- // Mark portlet interaction is completed: backend implementation can flush response state now
- responseContext.close();
- }
- finally
- {
- responseContext.release();
- }
-
- debugWithName("Portlet admin request done for: " + portletWindow.getPortletDefinition().getPortletName());
- }
-
-
- /**
- * @see org.apache.pluto.container.PortletContainer#getName()
- */
- public String getName() {
- return name;
- }
-
- /**
- * @see org.apache.pluto.container.PortletContainer#getContainerServices()
- */
- 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 event the event
- * @throws PortletException
- * @throws IOException
- * @throws PortletContainerException
- *
- * @see javax.portlet.EventPortlet#processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)
- */
- public void doEvent(PortletWindow portletWindow,
- HttpServletRequest request,
- HttpServletResponse response,
- Event event)
- throws PortletException, IOException, PortletContainerException
- {
- ensureInitialized();
-
- debugWithName("Event: "+event.getName()+" received for portlet: "
- + portletWindow.getPortletDefinition().getPortletName());
-
- 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);
- EventRequest portletRequest = envService.createEventRequest(requestContext, responseContext, event);
- EventResponse portletResponse = envService.createEventResponse(responseContext);
-
- FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.EVENT_PHASE);
-
- List<Event> events = null;
- try
- {
- invoker.event(requestContext, portletRequest, portletResponse, filterManager);
-
- debugWithName("Portlet event processed for: "
- + portletWindow.getPortletDefinition().getPortletName());
-
- // Mark portlet interaction is completed: backend implementation can flush response state now
- responseContext.close();
- events = responseContext.getEvents();
- }
- finally
- {
- responseContext.release();
- }
-
- if (events != null && !events.isEmpty())
- {
- getContainerServices().getEventCoordinationService().processEvents(this, portletWindow, request, response, events);
- }
-
- debugWithName("Portlet event: "+ event.getName() +" fired for: " + portletWindow.getPortletDefinition().getPortletName());
- }
-
- // Private Methods ---------------------------------------------------------
-
- /**
- * Ensures that the portlet container is initialized.
- * @throws IllegalStateException if the container is not initialized.
- */
- private void ensureInitialized() throws IllegalStateException {
- if (!isInitialized()) {
- throw new IllegalStateException(
- "Portlet container [" + name + "] is not initialized.");
- }
- }
-
- /**
- * Prints a message at DEBUG level with the container name prefix.
- * @param message log message.
- */
- private void debugWithName(String message) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Portlet Container [" + name + "]: " + message);
- }
- }
-
- /**
- * Prints a message at INFO level with the container name prefix.
- * @param message log message.
- */
- private void infoWithName(String message) {
- if (LOG.isInfoEnabled()) {
- LOG.info("Portlet Container [" + name + "]: " + message);
- }
- }
-
- /**
- * The method initialise the FilterManager for later use in the PortletServlet
- * @param portletWindow the PortletWindow
- * @param lifeCycle like ACTION_PHASE, RENDER_PHASE,...
- * @return FilterManager
- * @throws PortletContainerException
- */
- private FilterManager filterInitialisation(PortletWindow portletWindow, String lifeCycle) throws PortletContainerException{
- return getContainerServices().getFilterManagerService().getFilterManager(portletWindow, lifeCycle);
- }
-}
-
+/*
+ * 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.impl;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Event;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.container.ContainerServices;
+import org.apache.pluto.container.FilterManager;
+import org.apache.pluto.container.PortletActionResponseContext;
+import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletContainerException;
+import org.apache.pluto.container.PortletEnvironmentService;
+import org.apache.pluto.container.PortletEventResponseContext;
+import org.apache.pluto.container.PortletInvokerService;
+import org.apache.pluto.container.PortletRenderResponseContext;
+import org.apache.pluto.container.PortletRequestContext;
+import org.apache.pluto.container.PortletRequestContextService;
+import org.apache.pluto.container.PortletResourceRequestContext;
+import org.apache.pluto.container.PortletResourceResponseContext;
+import org.apache.pluto.container.PortletWindow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Default Pluto Container implementation.
+ *
+ * @version 1.0
+ * @since Sep 18, 2004
+ */
+public class PortletContainerImpl implements PortletContainer
+{
+
+ /** Internal logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(PortletContainerImpl.class);
+
+
+ // Private Member Variables ------------------------------------------------
+
+ /** The portlet container name. */
+ private final String name;
+
+ /** The container services associated with this container. */
+ private final ContainerServices containerServices;
+
+ /** Flag indicating whether or not we've been initialized. */
+ private boolean initialized = false;
+
+
+ // Constructor -------------------------------------------------------------
+
+ /** Default Constructor. Create a container implementation
+ * whith the given name and given services.
+ *
+ * @param name the name of the container.
+ * @param requiredServices the required container services implementation.
+ */
+ public PortletContainerImpl(String name,
+ ContainerServices requiredServices) {
+ this.name = name;
+ this.containerServices = requiredServices;
+ }
+
+
+ // PortletContainer Impl ---------------------------------------------------
+
+ /**
+ * Initialize the container for use within the given configuration scope.
+ */
+ public void init()
+ throws PortletContainerException {
+ this.initialized = true;
+ infoWithName("Container initialized successfully.");
+ }
+
+ /**
+ * Determine whether this container has been initialized or not.
+ * @return true if the container has been initialized.
+ */
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ /**
+ * Destroy this container.
+ */
+ public void destroy() {
+ this.initialized = false;
+ infoWithName("Container destroyed.");
+ }
+
+
+ /**
+ * Renders the portlet associated with the specified portlet window.
+ * @param portletWindow the portlet window.
+ * @param request the servlet request.
+ * @param response the servlet response.
+ * @throws IllegalStateException if the container is not initialized.
+ * @throws PortletException
+ * @throws IOException
+ * @throws PortletContainerException
+ *
+ * @see javax.portlet.Portlet#render(RenderRequest, RenderResponse)
+ */
+ public void doRender(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws PortletException, IOException, PortletContainerException
+ {
+ ensureInitialized();
+
+ debugWithName("Render request received for portlet: "
+ + portletWindow.getPortletDefinition().getPortletName());
+
+ 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);
+ RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
+ RenderResponse portletResponse = envService.createRenderResponse(responseContext);
+
+ FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RENDER_PHASE);
+
+ try
+ {
+ invoker.render(requestContext, portletRequest, portletResponse, filterManager);
+ // Mark portlet interaction is completed: backend implementation can flush response state now
+ responseContext.close();
+ }
+ finally
+ {
+ responseContext.release();
+ }
+
+ debugWithName("Portlet render done for: " + portletWindow.getPortletDefinition().getPortletName());
+ }
+
+ /**
+ * 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 request the servlet request
+ * @param response the servlet response
+ * @throws PortletException if one portlet has trouble fulfilling
+ * the request
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ public void doServeResource(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws PortletException, IOException, PortletContainerException
+ {
+ ensureInitialized();
+
+ debugWithName("Resource request received for portlet: "
+ + portletWindow.getPortletDefinition().getPortletName());
+
+ 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);
+ ResourceRequest portletRequest = envService.createResourceRequest(requestContext, responseContext);
+ ResourceResponse portletResponse = envService.createResourceResponse(responseContext, requestContext.getCacheability());
+
+ FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RESOURCE_PHASE);
+
+ try
+ {
+ invoker.serveResource(requestContext, portletRequest, portletResponse, filterManager);
+ // Mark portlet interaction is completed: backend implementation can flush response state now
+ responseContext.close();
+ }
+ finally
+ {
+ responseContext.release();
+ }
+
+ debugWithName("Portlet resource done for: " + portletWindow.getPortletDefinition().getPortletName());
+ }
+
+ /**
+ * Process action for the portlet associated with the given portlet window.
+ * @param portletWindow the portlet window.
+ * @param request the servlet request.
+ * @param response the servlet response.
+ * @param isRedirect Flag indicating whether redirect is to be performed.
+ * should be true for Action request and false for Ajax Action or
+ * Partial Action requests.
+ * @throws PortletException
+ * @throws IOException
+ * @throws PortletContainerException
+ *
+ * @see javax.portlet.Portlet#processAction(ActionRequest, ActionResponse)
+ */
+ public void doAction(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ boolean isRedirect)
+ throws PortletException, IOException, PortletContainerException
+ {
+ ensureInitialized();
+
+ debugWithName("Action request received for portlet: "
+ + portletWindow.getPortletDefinition().getPortletName());
+
+ 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);
+ ActionRequest portletRequest = envService.createActionRequest(requestContext, responseContext);
+ ActionResponse portletResponse = envService.createActionResponse(responseContext);
+
+ FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.ACTION_PHASE);
+
+ String location = null;
+ String logtxt = "Portlet action";
+ if (isRedirect) {
+ logtxt = "Portlet Ajax or Partial action";
+ }
+
+ try
+ {
+ invoker.action(requestContext, portletRequest, portletResponse, filterManager);
+
+ debugWithName(logtxt + " processed for: "
+ + portletWindow.getPortletDefinition().getPortletName());
+
+ // Mark portlet interaction is completed: backend implementation can flush response state now
+ responseContext.close();
+
+ if (!responseContext.isRedirect())
+ {
+ List<Event> events = responseContext.getEvents();
+ if (!events.isEmpty())
+ {
+ getContainerServices().getEventCoordinationService().processEvents(this, portletWindow, request, response, events);
+ }
+ }
+
+ // After processing action and possible event handling, retrieve the target response URL to be redirected to
+ // This can either be a renderURL or an external URL (optionally containing a future renderURL as query parameter
+ location = response.encodeRedirectURL(responseContext.getResponseURL());
+ }
+ finally
+ {
+ responseContext.release();
+ }
+ if (isRedirect) {
+ redirect(request, response, location);
+ }
+
+ debugWithName(logtxt + " done for: " + portletWindow.getPortletDefinition().getPortletName());
+ }
+
+ protected void redirect(HttpServletRequest request, HttpServletResponse response, String location) throws IOException
+ {
+ // Here we intentionally use the original response
+ // instead of the wrapped internal response.
+ response.sendRedirect(location);
+ debugWithName("Redirect URL sent.");
+ }
+
+ /**
+ * Loads the portlet associated with the specified portlet window.
+ * @param portletWindow the portlet window.
+ * @param request the servlet request.
+ * @param response the servlet response.
+ * @throws PortletException
+ * @throws IOException
+ * @throws PortletContainerException
+ */
+ public void doLoad(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws PortletException, IOException, PortletContainerException
+ {
+ ensureInitialized();
+
+ debugWithName("Load request received for portlet: "
+ + portletWindow.getPortletDefinition().getPortletName());
+
+ 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);
+ RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
+ RenderResponse portletResponse = envService.createRenderResponse(responseContext);
+
+ try
+ {
+ invoker.load(requestContext, portletRequest, portletResponse);
+ // Mark portlet interaction is completed: backend implementation can flush response state now
+ responseContext.close();
+ }
+ finally
+ {
+ responseContext.release();
+ }
+
+ debugWithName("Portlet load done for: " + portletWindow.getPortletDefinition().getPortletName());
+ }
+
+
+ public void doAdmin(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws PortletException, IOException, PortletContainerException
+ {
+ ensureInitialized();
+
+ debugWithName("Admin request received for portlet: "
+ +portletWindow.getPortletDefinition().getPortletName());
+
+ 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);
+ RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
+ RenderResponse portletResponse = envService.createRenderResponse(responseContext);
+
+ try
+ {
+ invoker.admin(requestContext, portletRequest, portletResponse);
+ // Mark portlet interaction is completed: backend implementation can flush response state now
+ responseContext.close();
+ }
+ finally
+ {
+ responseContext.release();
+ }
+
+ debugWithName("Portlet admin request done for: " + portletWindow.getPortletDefinition().getPortletName());
+ }
+
+
+ /**
+ * @see org.apache.pluto.container.PortletContainer#getName()
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @see org.apache.pluto.container.PortletContainer#getContainerServices()
+ */
+ 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 event the event
+ * @throws PortletException
+ * @throws IOException
+ * @throws PortletContainerException
+ *
+ * @see javax.portlet.EventPortlet#processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)
+ */
+ public void doEvent(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ Event event)
+ throws PortletException, IOException, PortletContainerException
+ {
+ ensureInitialized();
+
+ debugWithName("Event: "+event.getName()+" received for portlet: "
+ + portletWindow.getPortletDefinition().getPortletName());
+
+ 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);
+ EventRequest portletRequest = envService.createEventRequest(requestContext, responseContext, event);
+ EventResponse portletResponse = envService.createEventResponse(responseContext);
+
+ FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.EVENT_PHASE);
+
+ List<Event> events = null;
+ try
+ {
+ invoker.event(requestContext, portletRequest, portletResponse, filterManager);
+
+ debugWithName("Portlet event processed for: "
+ + portletWindow.getPortletDefinition().getPortletName());
+
+ // Mark portlet interaction is completed: backend implementation can flush response state now
+ responseContext.close();
+ events = responseContext.getEvents();
+ }
+ finally
+ {
+ responseContext.release();
+ }
+
+ if (events != null && !events.isEmpty())
+ {
+ getContainerServices().getEventCoordinationService().processEvents(this, portletWindow, request, response, events);
+ }
+
+ debugWithName("Portlet event: "+ event.getName() +" fired for: " + portletWindow.getPortletDefinition().getPortletName());
+ }
+
+ // Private Methods ---------------------------------------------------------
+
+ /**
+ * Ensures that the portlet container is initialized.
+ * @throws IllegalStateException if the container is not initialized.
+ */
+ private void ensureInitialized() throws IllegalStateException {
+ if (!isInitialized()) {
+ throw new IllegalStateException(
+ "Portlet container [" + name + "] is not initialized.");
+ }
+ }
+
+ /**
+ * Prints a message at DEBUG level with the container name prefix.
+ * @param message log message.
+ */
+ private void debugWithName(String message) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Portlet Container [" + name + "]: " + message);
+ }
+ }
+
+ /**
+ * Prints a message at INFO level with the container name prefix.
+ * @param message log message.
+ */
+ private void infoWithName(String message) {
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Portlet Container [" + name + "]: " + message);
+ }
+ }
+
+ /**
+ * The method initialise the FilterManager for later use in the PortletServlet
+ * @param portletWindow the PortletWindow
+ * @param lifeCycle like ACTION_PHASE, RENDER_PHASE,...
+ * @return FilterManager
+ * @throws PortletContainerException
+ */
+ private FilterManager filterInitialisation(PortletWindow portletWindow, String lifeCycle) throws PortletContainerException{
+ return getContainerServices().getFilterManagerService().getFilterManager(portletWindow, lifeCycle);
+ }
+}
+