Author: julien(a)jboss.com
Date: 2008-02-09 11:22:50 -0500 (Sat, 09 Feb 2008)
New Revision: 9904
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/PageEventControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java
Log:
some basic javadoc
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:18:37 UTC (rev 9903)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java 2008-02-09
16:22:50 UTC (rev 9904)
@@ -88,12 +88,13 @@
//
PortalActionResponse actionResponse = new PortalActionResponse(resp, invoker);
- // Discover existing portlets on the page
+ // Discover existing portlets on the page (introspection phase)
chain.doFilter(req, actionResponse);
// Now we can create a populated context
PagePortletControllerContext context = new PagePortletControllerContext(req, resp,
getServletContext(), actionResponse);
+ //
PageNavigationalState pageState = null;
if (context.getRequest() != null)
{
@@ -217,79 +218,4 @@
{
this.config = null;
}
-
- protected void render(HttpServletRequest req, PortalRenderResponse resp) throws
ServletException, IOException, ClassNotFoundException
- {
-
- //
-// PagePortletControllerContext context = resp.getPortletControllerContext();
-
- //
-
- // Look if we need to handle maxmized rendering
-/*
- for (Window window : page.getWindows())
- {
- WindowNavigationalState windowState =
pageState.getWindowNavigationalState(window.getId());
- if (windowState != null &&
WindowState.MAXIMIZED.equals(windowState.getWindowState()))
- {
- List<Chunk> chunks = new LinkedList<Chunk>();
- int mode = 0;
- int count = 0;
- Map<StartPortletChunk, Window> windows = Collections.emptyMap();
- for (Iterator<Chunk> i = page.getChunks().iterator();i.hasNext();)
- {
- Chunk chunk = i.next();
-
- switch (mode)
- {
- case 0:
- if (chunk instanceof StartPageChunk)
- {
- mode = 1;
- chunks.add(chunk);
- }
- break;
- case 1:
- if (chunk instanceof StartPortletChunk)
- {
- StartPortletChunk startPortletChunk = (StartPortletChunk)chunk;
- String windowId = "" + count;
- if (window.getId().equals(windowId))
- {
- mode = 2;
- chunks.add(startPortletChunk);
- windows = Collections.singletonMap(startPortletChunk,
window);
- }
- }
- else if (chunk instanceof EndPageChunk)
- {
- mode = 0;
- chunks.add(chunk);
- }
- break;
- case 2:
- if (chunk instanceof EndPortletChunk)
- {
- mode = 1;
- }
-
- //
- chunks.add(chunk);
- break;
- }
-
- //
- if (chunk instanceof EndPortletChunk)
- {
- count++;
- }
- }
-
- // New page
- page = new Page(chunks, windows);
- }
- }
-*/
- }
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PageEventControllerContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PageEventControllerContext.java 2008-02-09
16:18:37 UTC (rev 9903)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PageEventControllerContext.java 2008-02-09
16:22:50 UTC (rev 9904)
@@ -31,6 +31,9 @@
import java.util.ArrayList;
/**
+ * Route events according to the portlets discovered on the page. For now it is pretty
trivial.
+ * We could leverage JSP tags to 'wire' portlets on the same page for instance.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java 2008-02-09
16:18:37 UTC (rev 9903)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java 2008-02-09
16:22:50 UTC (rev 9904)
@@ -33,6 +33,8 @@
import java.util.HashMap;
/**
+ * Expose stuff common to action and render response.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
@@ -80,6 +82,10 @@
return portlets.get(new Key(applicationName, portletName));
}
+ /**
+ * todo : add on JSP portlet tag a notion of 'id', because this id generation
relies on the portlet
+ * rendering order on the page which could not be the same between 2 requests.
+ */
public String nextId()
{
return "" + count++;