Author: julien(a)jboss.com
Date: 2008-02-09 11:18:37 -0500 (Sat, 09 Feb 2008)
New Revision: 9903
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java
Log:
no need to use the window id that contains the portlet context id marshalled in since we
always have a map of window id -> Portlet
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java 2008-02-09
16:11:20 UTC (rev 9902)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java 2008-02-09
16:18:37 UTC (rev 9903)
@@ -85,32 +85,18 @@
{
PortletInvoker invoker =
(PortletInvoker)getServletContext().getAttribute("ConsumerPortletInvoker");
-
+ //
PortalActionResponse actionResponse = new PortalActionResponse(resp, invoker);
+ // Discover existing portlets on the page
chain.doFilter(req, actionResponse);
- //
- PagePortletControllerContext context;
- try
- {
- context = new PagePortletControllerContext(
- req,
- resp,
- getServletContext(),
- actionResponse);
- }
- catch (PortletInvokerException e)
- {
- throw new ServletException(e);
- }
+ // Now we can create a populated context
+ PagePortletControllerContext context = new PagePortletControllerContext(req, resp,
getServletContext(), actionResponse);
PageNavigationalState pageState = null;
if (context.getRequest() != null)
{
-
-
-
ControllerResponse controllerResponse;
try
{
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java 2008-02-09
16:11:20 UTC (rev 9902)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java 2008-02-09
16:18:37 UTC (rev 9903)
@@ -23,7 +23,6 @@
package org.jboss.portal.portlet.test.jsp;
import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -48,7 +47,7 @@
private final EventControllerContext eventControllerContext;
/** . */
- private final PortalResponse actionResponse;
+ private final PortalActionResponse actionResponse;
public PagePortletControllerContext(
HttpServletRequest req,
@@ -66,20 +65,7 @@
protected Portlet getPortlet(String windowId) throws PortletInvokerException
{
- int index = windowId.lastIndexOf('.');
- String portletId = windowId.substring(0, index);
-
- // in the case of an event propagation, the given 'windowId' is actually
the portlet id already so need to check
- // for that case (portletId should still have a '.', if not it means that
the windowId was really a portlet id)
-// if (portletId.indexOf('.') == -1)
-// {
-// portletId = windowId;
-// }
-
- PortletContext portletContext = PortletContext.createPortletContext(portletId);
-
- //
- return actionResponse.getInvoker().getPortlet(portletContext);
+ return actionResponse.getPortlet(windowId);
}
public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java 2008-02-09
16:11:20 UTC (rev 9902)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java 2008-02-09
16:18:37 UTC (rev 9903)
@@ -188,11 +188,7 @@
Portlet portlet = portalResponse.findPortlet(applicationNameAttr, nameAttr);
//
- String windowId = null;
- if (portlet != null)
- {
- windowId = portlet.getContext().getId() + "." +
portalResponse.nextId();
- }
+ String windowId = portalResponse.nextId();
//
this.initialMode = initialMode;
Show replies by date