Author: julien(a)jboss.com
Date: 2007-04-07 06:13:16 -0400 (Sat, 07 Apr 2007)
New Revision: 6942
Added:
trunk/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java
trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRendererContextImpl.java
trunk/theme/src/main/org/jboss/portal/theme/page/PortletRendererContextImpl.java
trunk/theme/src/main/org/jboss/portal/theme/render/RendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/ThemeContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ActionRendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PageRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PageRendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRendererContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRendererContext.java
Removed:
trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRenderContextImpl.java
trunk/theme/src/main/org/jboss/portal/theme/page/PortletRenderContextImpl.java
trunk/theme/src/main/org/jboss/portal/theme/render/ActionRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java
trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderer.java
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java
trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestDecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestPortletRenderer.java
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRegionRenderer.java
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestWindowRenderer.java
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/TestLayoutServiceImpl.java
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/servlet/TestThemeServlet.java
trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java
trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java
trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java
trunk/theme/src/main/org/jboss/portal/theme/PortalTheme.java
trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java
trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java
trunk/theme/src/main/org/jboss/portal/theme/impl/RendererFactoryImpl.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivPortletRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivRegionRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivWindowRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRegionRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaStatus.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaWindowRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyDecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyPortletRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyRegionRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyWindowRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/page/PageRendition.java
trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
trunk/theme/src/main/org/jboss/portal/theme/page/Region.java
trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java
trunk/theme/src/main/org/jboss/portal/theme/page/WindowResult.java
trunk/theme/src/main/org/jboss/portal/theme/render/RendererFactory.java
trunk/theme/src/main/org/jboss/portal/theme/tag/PortletTagHandler.java
trunk/theme/src/main/org/jboss/portal/theme/tag/RegionTagHandler.java
trunk/theme/src/main/org/jboss/portal/theme/tag/ThemeTagHandler.java
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/ForEachActionInWindowTag.java
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/ForEachWindowInRegionTag.java
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/IfRegionExistsTag.java
Log:
- added ThemeContext object for carrying the current PortalTheme and the ThemeService for
additional lookup
- make some repackinging to avoid mess
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -56,19 +56,18 @@
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageLocationResponse;
import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageStateResponse;
-import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
import org.jboss.portal.theme.impl.render.dynamic.DynaStatus;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.PageService;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.ThemeContext;
import org.jboss.portal.theme.page.PageResult;
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.portal.theme.page.WindowContext;
import javax.servlet.ServletException;
import java.io.IOException;
-import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Set;
import java.util.HashSet;
@@ -306,15 +305,18 @@
// Get a dispatcher
ServletContextDispatcher dispatcher = new
ServletContextDispatcher(invocation.getServerContext().getClientRequest(),
invocation.getServerContext().getClientResponse(),
controllerContext.getController().getServletContainerContext());
+ // Not really used for now in that context, so we can pass null
(need to change that of course)
+ ThemeContext themeContext = new ThemeContext(null, null);
+
// get render context
- RenderContext renderContext = layout.getRenderContext(markupInfo,
dispatcher, buffer);
+ RendererContext rendererContext =
layout.getRenderContext(themeContext, markupInfo, dispatcher, buffer);
// Should push region context as well
- DynaStatus.set(renderContext, DynaStatus.DYNA_RENDERED_VALUE);
- renderContext.pushObjectRenderContext(res);
+ DynaStatus.set(rendererContext, DynaStatus.DYNA_RENDERED_VALUE);
+ rendererContext.pushObjectRenderContext(res);
// Render
- renderContext.render(wc);
+ rendererContext.render(wc);
// Add render to the page
updatePage.addFragment(wc.getId(), buffer.toString());
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -57,7 +57,7 @@
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
import org.jboss.portal.theme.page.WindowResult;
-import org.jboss.portal.theme.render.ActionRenderContext;
+import org.jboss.portal.theme.render.renderer.ActionRendererContext;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.Exceptions;
@@ -309,8 +309,8 @@
windowTitle = "Portlet unavailable";
contentChars = "Portlet unavailable";
actionMap = new HashMap();
- actionMap.put(ActionRenderContext.MODES_KEY, Collections.EMPTY_LIST);
- actionMap.put(ActionRenderContext.WINDOWSTATES_KEY,
Collections.EMPTY_LIST);
+ actionMap.put(ActionRendererContext.MODES_KEY, Collections.EMPTY_LIST);
+ actionMap.put(ActionRendererContext.WINDOWSTATES_KEY,
Collections.EMPTY_LIST);
return new WindowResult(windowTitle, contentChars, actionMap, windowProps,
new Properties(), headerChars, windowNS.getWindowState(), windowNS.getMode());
}
}
@@ -332,8 +332,8 @@
}
if
(RenderWindowCommand.SHOW.equals(cfg.getProperty(RenderWindowCommand.WINDOW_ACCESS_DENIED)))
{
- actionMap.put(ActionRenderContext.MODES_KEY, Collections.EMPTY_LIST);
- actionMap.put(ActionRenderContext.WINDOWSTATES_KEY, Collections.EMPTY_LIST);
+ actionMap.put(ActionRendererContext.MODES_KEY, Collections.EMPTY_LIST);
+ actionMap.put(ActionRendererContext.WINDOWSTATES_KEY,
Collections.EMPTY_LIST);
windowTitle = "Access denied";
contentChars = "Access denied";
return new WindowResult(windowTitle, contentChars, actionMap, windowProps,
new Properties(), headerChars, windowNS.getWindowState(), windowNS.getMode());
@@ -347,8 +347,8 @@
}
if
(RenderWindowCommand.SHOW.equals(cfg.getProperty(RenderWindowCommand.WINDOW_NOT_FOUND)))
{
- actionMap.put(ActionRenderContext.MODES_KEY, Collections.EMPTY_LIST);
- actionMap.put(ActionRenderContext.WINDOWSTATES_KEY, Collections.EMPTY_LIST);
+ actionMap.put(ActionRendererContext.MODES_KEY, Collections.EMPTY_LIST);
+ actionMap.put(ActionRendererContext.WINDOWSTATES_KEY,
Collections.EMPTY_LIST);
windowTitle = "Cannot render";
contentChars = "Object not found " + e.getRef();
return new WindowResult(windowTitle, contentChars, actionMap, windowProps,
new Properties(), headerChars, windowNS.getWindowState(), windowNS.getMode());
@@ -395,7 +395,7 @@
WindowResult.Action action = new WindowResult.Action(windowState.toString(),
url, !disabled);
windowStates.add(action);
}
- actionMap.put(ActionRenderContext.WINDOWSTATES_KEY, windowStates);
+ actionMap.put(ActionRendererContext.WINDOWSTATES_KEY, windowStates);
}
/**
@@ -413,7 +413,7 @@
WindowResult.Action action = new WindowResult.Action(mode.toString(), url,
!disabled);
modes.add(action);
}
- actionMap.put(ActionRenderContext.MODES_KEY, modes);
+ actionMap.put(ActionRendererContext.MODES_KEY, modes);
}
private String createUpdateNavigationalStateURL(ControllerContext context, Window
window, Mode mode, WindowState windowState)
Modified:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -113,7 +113,7 @@
result.addWindowContext(blah);
//
- return new PageRendition(layout, result, ps);
+ return new PageRendition(layout, null, result, ps);
}
catch (PortletInvokerException e)
{
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -203,12 +203,6 @@
new HashMap(getPage().getDeclaredProperties()),
new HashMap(getPage().getPortal().getDeclaredProperties()));
- // Set the theme on the result
- if (theme != null)
- {
- pageResult.setTheme(theme);
- }
-
// Render the windows
for (Iterator i = windows.iterator(); i.hasNext();)
{
@@ -257,17 +251,12 @@
}
//
- return new PageRendition(layout, pageResult, pageService);
+ return new PageRendition(layout, theme, pageResult, pageService);
}
catch (Exception e)
{
rethrow(e);
}
- finally
- {
- request.removeAttribute(ThemeConstants.ATTR_THEME_SERVER);
- request.removeAttribute(ThemeConstants.ATTR_THEME);
- }
//
return null;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -49,7 +49,7 @@
import org.jboss.portal.theme.ThemeService;
import org.jboss.portal.theme.PortalTheme;
import org.jboss.portal.theme.ServerRegistrationID;
-import org.jboss.portal.theme.render.PortalRenderSet;
+import org.jboss.portal.theme.PortalRenderSet;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java 2007-04-07 00:31:37
UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java 2007-04-07 10:13:16
UTC (rev 6942)
@@ -33,8 +33,9 @@
import org.jboss.portal.theme.page.WindowContext;
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
-import org.jboss.portal.theme.render.PortalRenderSet;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.PortalRenderSet;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.ThemeContext;
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.web.ServletContextDispatcher;
@@ -87,7 +88,6 @@
PageResult pageRenderCtx = new PageResult("test_page");
//
- pageRenderCtx.setTheme(theme);
pageRenderCtx.setLayoutState(null);
//
@@ -116,15 +116,15 @@
ServletContextDispatcher dispatcher = new ServletContextDispatcher(request,
response, servletContainerContext);
- RenderContext renderCtx = layout.getRenderContext(markupInfo, dispatcher);
+ ThemeContext themeContext = new ThemeContext(theme, themeService);
+ RendererContext rendererCtx = layout.getRenderContext(themeContext, markupInfo,
dispatcher);
+
pageRenderCtx.getPageProperties().put(DynaConstants.OBJECT_ENABLED,
"true");
- renderCtx.setAttribute(ThemeConstants.ATTR_THEME, theme);
+ rendererCtx.render(pageRenderCtx);
- renderCtx.render(pageRenderCtx);
-
// //
// ServerRequest serverRequest = new ServerRequest(null);
//
Modified:
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestDecorationRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestDecorationRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestDecorationRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.theme.render;
-import org.jboss.portal.theme.render.DecorationRenderer;
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.DecorationRenderContext;
+import org.jboss.portal.theme.render.renderer.DecorationRenderer;
+import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
import java.io.PrintWriter;
@@ -35,9 +35,9 @@
public class TestDecorationRenderer
implements DecorationRenderer
{
- public void render(RenderContext renderContext, DecorationRenderContext drc) throws
RenderException
+ public void render(RendererContext rendererContext, DecorationRendererContext drc)
throws RenderException
{
- PrintWriter writer = renderContext.getWriter();
+ PrintWriter writer = rendererContext.getWriter();
writer.print("<div
class=\"test-decoration\">Decoration</div>");
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestPortletRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestPortletRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestPortletRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.theme.render;
-import org.jboss.portal.theme.render.PortletRenderer;
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.PortletRenderContext;
+import org.jboss.portal.theme.render.renderer.PortletRenderer;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.renderer.PortletRendererContext;
import org.jboss.portal.theme.render.RenderException;
import java.io.PrintWriter;
@@ -35,9 +35,9 @@
public class TestPortletRenderer
implements PortletRenderer
{
- public void render(RenderContext renderContext, PortletRenderContext prc) throws
RenderException
+ public void render(RendererContext rendererContext, PortletRendererContext prc) throws
RenderException
{
- PrintWriter writer = renderContext.getWriter();
+ PrintWriter writer = rendererContext.getWriter();
writer.print("<div class=\"test-portlet\">");
writer.print(prc.getMarkup());
writer.print("</div>");
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRegionRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRegionRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRegionRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.theme.render;
-import org.jboss.portal.theme.render.RegionRenderer;
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.RegionRenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRenderer;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.WindowRenderContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import java.util.Iterator;
import java.io.PrintWriter;
@@ -38,24 +38,24 @@
implements RegionRenderer
{
- public void renderHeader(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderHeader(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
- PrintWriter writer = renderContext.getWriter();
+ PrintWriter writer = rendererContext.getWriter();
writer.print("<div class=\"test-region\">");
}
- public void renderFooter(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderFooter(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
- PrintWriter writer = renderContext.getWriter();
+ PrintWriter writer = rendererContext.getWriter();
writer.print("</div>");
}
- public void renderBody(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderBody(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
for (Iterator i = rrc.getWindows().iterator(); i.hasNext();)
{
- WindowRenderContext wrc = (WindowRenderContext)i.next();
- renderContext.render(wrc);
+ WindowRendererContext wrc = (WindowRendererContext)i.next();
+ rendererContext.render(wrc);
}
}
}
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/render/TestWindowRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestWindowRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestWindowRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.test.theme.render;
-import org.jboss.portal.theme.render.WindowRenderer;
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.WindowRenderContext;
+import org.jboss.portal.theme.render.renderer.WindowRenderer;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import org.jboss.portal.theme.render.RenderException;
import java.io.PrintWriter;
@@ -34,12 +34,12 @@
*/
public class TestWindowRenderer implements WindowRenderer
{
- public void render(RenderContext renderContext, WindowRenderContext wrc) throws
RenderException
+ public void render(RendererContext rendererContext, WindowRendererContext wrc) throws
RenderException
{
- PrintWriter writer = renderContext.getWriter();
+ PrintWriter writer = rendererContext.getWriter();
writer.print("<div class=\"test-window\">");
- renderContext.render(wrc.getDecoration());
- renderContext.render(wrc.getPortlet());
+ rendererContext.render(wrc.getDecoration());
+ rendererContext.render(wrc.getPortlet());
writer.print("</div>");
}
}
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/tmp/TestLayoutServiceImpl.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/TestLayoutServiceImpl.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/TestLayoutServiceImpl.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -30,6 +30,7 @@
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ServerRegistrationID;
+import org.jboss.portal.theme.PortalRenderSet;
import org.jboss.portal.theme.deployment.jboss.PortalLayoutMetaDataFactory;
import org.jboss.portal.theme.deployment.jboss.RenderSetMetaDataFactory;
import org.jboss.portal.theme.impl.LayoutServiceImpl;
@@ -47,7 +48,6 @@
import org.jboss.portal.theme.impl.render.empty.EmptyWindowRenderer;
import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
import org.jboss.portal.theme.metadata.RenderSetMetaData;
-import org.jboss.portal.theme.render.PortalRenderSet;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified:
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -34,6 +34,7 @@
import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.ThemeService;
+import org.jboss.portal.theme.PortalRenderSet;
import org.jboss.portal.theme.deployment.jboss.PortalLayoutMetaDataFactory;
import org.jboss.portal.theme.deployment.jboss.PortalThemeMetaDataFactory;
import org.jboss.portal.theme.deployment.jboss.RenderSetMetaDataFactory;
@@ -46,7 +47,6 @@
import org.jboss.portal.theme.page.WindowContext;
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.portal.theme.page.PageResult;
-import org.jboss.portal.theme.render.PortalRenderSet;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -141,7 +141,6 @@
// pageresult obj
PageResult pageResult = new PageResult(TEST_PAGE_NAME, pageProps, portalProps);
- pageResult.setTheme(theme);
// create window ctx/results and add to page result
for (int i = 0; i < LEFT_WINDOWS; i++)
Modified:
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/servlet/TestThemeServlet.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/servlet/TestThemeServlet.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/servlet/TestThemeServlet.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -23,127 +23,10 @@
package org.jboss.portal.test.theme.tmp.servlet;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.PageService;
-import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
-import org.jboss.portal.theme.page.WindowContext;
-import org.jboss.portal.theme.page.WindowResult;
-import org.jboss.portal.theme.page.PageResult;
-import org.jboss.portal.theme.render.PortalRenderSet;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class TestThemeServlet extends HttpServlet
{
-
-
- private static final String TEST_PAGE_NAME = "TestPage";
-
- /** How many windows to create on left region * */
- private static final int LEFT_WINDOWS = 3;
-
- /** How many windows to create on center region * */
- private static final int CENTER_WINDOWS = 3;
-
- /**
- * Generates a portal page with windows, using the theme api.
- */
- protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
- {
- try
- {
- proceed(request, response);
- }
- catch (Exception e)
- {
- throw new ServletException(e);
- }
- }
-
- public void proceed(HttpServletRequest request, HttpServletResponse response) throws
Exception
- {
- MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
-
- LayoutService layoutService = (LayoutService)MBeanProxy.get(LayoutService.class,
new ObjectName("portal:service=LayoutService"), mbeanServer);
- ThemeService themeService = (ThemeService)MBeanProxy.get(ThemeService.class, new
ObjectName("portal:service=ThemeService"), mbeanServer);
- PageService pageService = (PageService)MBeanProxy.get(PageService.class, new
ObjectName("portal:service=PageService"), mbeanServer);
-
- PortalRenderSet renderSet = layoutService.getRenderSet("divRenderer",
MediaType.HTML);
- PortalLayout layout = layoutService.getLayout("generic", true);
- PortalTheme theme = themeService.getTheme("renaissance", true);
-
-
- //
- Map pageProps = new HashMap();
- pageProps.put(DynaConstants.DYNA_RESOURCE_BASE_URL, "/portal-ajax");
- pageProps.put(DynaConstants.ASYNC_SERVER_URL,
"http://localhost:8080/portal-ajax/ajax");
-
- //
- Map portalProps = new HashMap();
- portalProps.put(ThemeConstants.PORTAL_PROP_RENDERSET, renderSet.getName());
-
- //
- MarkupInfo markupInfo = new MarkupInfo(MediaType.HTML, "utf-8");
- ServerRequest serverRequest = new ServerRequest(null);
-
- // pageresult obj
- PageResult pageResult = new PageResult(TEST_PAGE_NAME, pageProps, portalProps);
- pageResult.setTheme(theme);
-
- // create window ctx/results and add to page result
- for (int i = 0; i < LEFT_WINDOWS; i++)
- {
- WindowContext wCtx = new WindowContext("WindowA_" + i,
"WindowA_" + i, "left", i, createWindowMarkup("WindowA_" + i
+ " Title", "<p>WindowA_" + i + "
Content</p>"));
- pageResult.addWindowContext(wCtx);
- }
- for (int i = 0; i < CENTER_WINDOWS; i++)
- {
- WindowContext wCtx = new WindowContext("WindowB_" + i,
"WindowB_" + i, "center", i, createWindowMarkup("WindowB_" +
i + " Title", "<p>WindowB_" + i + "
Content</p>"));
- pageResult.addWindowContext(wCtx);
- }
-
- // set the renderctx and req/res attr
-// RenderContext renderCtx = new RenderContext(layout, markupInfo, pageResult);
-// response.setContentType(renderCtx.getContentType().toString());
-// response.setCharacterEncoding(renderCtx.getCharset());
-// request.setAttribute(LayoutConstants.ATTR_RENDERCONTEXT, renderCtx);
-// request.setAttribute(LayoutConstants.ATTR_PAGE, pageResult);
-// request.setAttribute(ThemeConstants.ATTR_THEME, theme);
-
- //
-// LayoutDispatcher dispatcher1 = new LayoutDispatcher(renderCtx, request, response,
pageResult);
-// dispatcher1.include();
- }
-
- /**
- * Generates the WindowResult for our windowcontext
- *
- * @param sTitle
- * @param sContent
- * @return window markup result
- */
- private WindowResult createWindowMarkup(String sTitle, String sContent)
- {
- return new WindowResult(sTitle, sContent, Collections.EMPTY_MAP, new HashMap(),
null, null, null, null);
- }
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java 2007-04-07 00:31:37
UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java 2007-04-07 10:13:16
UTC (rev 6942)
@@ -23,8 +23,8 @@
package org.jboss.portal.theme;
import org.jboss.portal.server.servlet.FilterCommand;
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.PageRenderContext;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.web.RequestDispatchCallback;
@@ -47,18 +47,18 @@
public final class LayoutDispatcher implements RequestDispatchCallback
{
- private final PageRenderContext markupResult;
- private final RenderContext renderContext;
+ private final PageRendererContext markupResult;
+ private final RendererContext rendererContext;
private final String layoutURI;
private final LayoutInfo layoutInfo;
/**
- * @param renderContext
+ * @param rendererContext
* @throws IllegalArgumentException if the layout is null
*/
public LayoutDispatcher(
- RenderContext renderContext,
- PageRenderContext result,
+ RendererContext rendererContext,
+ PageRendererContext result,
String layoutURI,
LayoutInfo layoutInfo)
throws IllegalArgumentException
@@ -69,7 +69,7 @@
throw new IllegalArgumentException("No null response allowed here");
}
- if (renderContext == null)
+ if (rendererContext == null)
{
throw new IllegalArgumentException("No render context provided");
}
@@ -79,7 +79,7 @@
}
this.markupResult = result;
- this.renderContext = renderContext;
+ this.rendererContext = rendererContext;
this.layoutURI = layoutURI;
this.layoutInfo = layoutInfo;
}
@@ -88,7 +88,7 @@
{
try
{
- ServletContextDispatcher dispatcher = renderContext.getDispatcher();
+ ServletContextDispatcher dispatcher = rendererContext.getDispatcher();
dispatcher.include(layoutInfo.getServletContext(), this, null);
}
catch (Exception e)
@@ -102,14 +102,14 @@
try
{
// Set charset and content type on the response
- dispatchedResponse.setContentType(renderContext.getContentType().toString());
- dispatchedResponse.setCharacterEncoding(renderContext.getCharset());
+ dispatchedResponse.setContentType(rendererContext.getContentType().toString());
+ dispatchedResponse.setCharacterEncoding(rendererContext.getCharset());
//
RequestDispatcher dispatcher =
dispatchedServletContext.getRequestDispatcher(layoutURI);
//
- dispatchedRequest.setAttribute(LayoutConstants.ATTR_RENDERCONTEXT,
renderContext);
+ dispatchedRequest.setAttribute(LayoutConstants.ATTR_RENDERCONTEXT,
rendererContext);
dispatchedRequest.setAttribute(FilterCommand.REQ_ATT_KEY, this);
dispatchedRequest.setAttribute(LayoutConstants.ATTR_PAGE, markupResult);
Modified: trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java 2007-04-07 00:31:37
UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java 2007-04-07 10:13:16
UTC (rev 6942)
@@ -25,8 +25,7 @@
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.ContentInfo;
-import org.jboss.portal.theme.render.PortalRenderSet;
-import org.jboss.portal.theme.page.PageResult;
+import org.jboss.portal.theme.PortalRenderSet;
import java.util.Collection;
Modified: trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java 2007-04-07 00:31:37 UTC
(rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java 2007-04-07 10:13:16 UTC
(rev 6942)
@@ -22,10 +22,9 @@
******************************************************************************/
package org.jboss.portal.theme;
-import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.PageRenderer;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.ThemeContext;
import org.jboss.portal.web.ServletContextDispatcher;
import java.io.Writer;
@@ -72,19 +71,28 @@
* Provides a render context that will render its markup in the response provided by
the servlet context
* dispatcher.
*
- * @param markupInfo
- * @param dispatcher
- * @return
+ * @param themeContext the theme context
+ * @param markupInfo the markup info
+ * @param dispatcher the way to dispatch to the layout and receive the produced
markup
+ * @return a render context
*/
- public abstract RenderContext getRenderContext(MarkupInfo markupInfo,
ServletContextDispatcher dispatcher);
+ public abstract RendererContext getRenderContext(
+ ThemeContext themeContext,
+ MarkupInfo markupInfo,
+ ServletContextDispatcher dispatcher);
/**
* Provides a render context that will render its markup in the provided writer.
*
- * @param markupInfo
- * @param dispatcher
- * @param writer
- * @return
+ * @param themeContext the theme context
+ * @param markupInfo the markup info
+ * @param dispatcher the way to dispatch to the layout
+ * @param writer the writer that will receive the produced markup
+ * @return a render context
*/
- public abstract RenderContext getRenderContext(MarkupInfo markupInfo,
ServletContextDispatcher dispatcher, Writer writer);
+ public abstract RendererContext getRenderContext(
+ ThemeContext themeContext,
+ MarkupInfo markupInfo,
+ ServletContextDispatcher dispatcher,
+ Writer writer);
}
Copied: trunk/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java (from rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java 2007-04-07 10:13:16
UTC (rev 6942)
@@ -0,0 +1,191 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme;
+
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.theme.RuntimeContext;
+import org.jboss.portal.theme.ServerRegistrationID;
+import org.jboss.portal.theme.render.renderer.ObjectRenderer;
+import org.jboss.portal.theme.render.renderer.PortletRenderer;
+import org.jboss.portal.theme.render.renderer.RegionRenderer;
+import org.jboss.portal.theme.render.renderer.DecorationRenderer;
+import org.jboss.portal.theme.render.renderer.WindowRenderer;
+import org.jboss.portal.theme.impl.render.dynamic.DynaDecorationRenderer;
+import org.jboss.portal.theme.impl.render.dynamic.DynaPortletRenderer;
+import org.jboss.portal.theme.impl.render.dynamic.DynaRegionRenderer;
+import org.jboss.portal.theme.impl.render.dynamic.DynaWindowRenderer;
+import org.jboss.portal.theme.metadata.RendererSetMetaData;
+
+/**
+ * The portal render set is a set of renderer implementations for the markup container of
a page. <p>A render set
+ * consists of 4 iterface implementations with some meta data describing the web
application the render set is coming
+ * from, and the content type it is capable of handling.</p>
+ *
+ * @author <a href="mailto:mholzner@novell.com">Martin
Holzner</a>.
+ * @version <tt>$Revision$</tt>
+ */
+public final class PortalRenderSet
+{
+
+ private final RegionRenderer regionRenderer;
+ private final WindowRenderer windowRenderer;
+ private final PortletRenderer portletRenderer;
+ private final DecorationRenderer decorationRenderer;
+ private final MediaType contentType;
+ private final String appID;
+ private final String name;
+ private final ServerRegistrationID registrationId;
+ private final boolean ajaxEnabled;
+
+ /**
+ * construct a render set
+ *
+ * @param renderSetName the name of the render set as defined in the
portal-renderSet.xml descriptor, or null if it
+ * was defined as part of a layout descriptor.
+ * @param runtimeContext the runtime environment (data describing the portal web
application in wich the render set
+ * was defined)
+ * @param rendererSetMD meta data about an individual set of 4 renderer
implementation together with their supported
+ * content type
+ * @throws IllegalAccessException
+ * @throws InstantiationException
+ * @throws ClassNotFoundException
+ */
+ public PortalRenderSet(String renderSetName, RuntimeContext runtimeContext,
RendererSetMetaData rendererSetMD) throws IllegalAccessException, InstantiationException,
ClassNotFoundException
+ {
+ // there CAN be render sets without a name !
+
+ if (runtimeContext == null)
+ {
+ throw new IllegalArgumentException("no valid container");
+ }
+ if (rendererSetMD == null)
+ {
+ throw new IllegalArgumentException("no valid set");
+ }
+ this.name = renderSetName;
+ this.appID = runtimeContext.getAppId();
+ this.registrationId =
ServerRegistrationID.createID(ServerRegistrationID.TYPE_RENDERSET, new String[]{appID,
name});
+ this.contentType = rendererSetMD.getContentType();
+ this.ajaxEnabled = rendererSetMD.isAjaxEnabled();
+
+ if (ajaxEnabled) // wrap the current renderer with the ajax delegator one.
+ {
+ this.regionRenderer = new
DynaRegionRenderer((RegionRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getRegionRenderer()));
+ this.windowRenderer = new
DynaWindowRenderer((WindowRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getWindowRenderer()));
+ this.portletRenderer = new
DynaPortletRenderer((PortletRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getPortletRenderer()));
+ this.decorationRenderer = new
DynaDecorationRenderer((DecorationRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getDecorationRenderer()));
+ }
+ else
+ {
+ this.regionRenderer =
(RegionRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getRegionRenderer());
+ this.windowRenderer =
(WindowRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getWindowRenderer());
+ this.portletRenderer =
(PortletRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getPortletRenderer());
+ this.decorationRenderer =
(DecorationRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getDecorationRenderer());
+ }
+ }
+
+ public ServerRegistrationID getRegistrationId()
+ {
+ return registrationId;
+ }
+
+ /**
+ * @see PortalRenderSet#getMediaType
+ */
+ public MediaType getMediaType()
+ {
+ return contentType;
+ }
+
+ /**
+ * Get the name of the application (the WAR) that contains this render set.
+ *
+ * @return the name of the application (the WAR) that contains this render set
+ */
+ public String getAppId()
+ {
+ return appID;
+ }
+
+ /**
+ * Get the name of this render set.
+ *
+ * @return the name of this render set
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * @see PortalRenderSet#getRegionRenderer
+ */
+ public RegionRenderer getRegionRenderer()
+ {
+ return regionRenderer;
+ }
+
+ /**
+ * @see PortalRenderSet#getWindowRenderer
+ */
+ public WindowRenderer getWindowRenderer()
+ {
+ return windowRenderer;
+ }
+
+ /**
+ * @see PortalRenderSet#getPortletRenderer
+ */
+ public PortletRenderer getPortletRenderer()
+ {
+ return portletRenderer;
+ }
+
+ /**
+ * @see PortalRenderSet#getDecorationRenderer
+ */
+ public DecorationRenderer getDecorationRenderer()
+ {
+ return decorationRenderer;
+ }
+
+ public boolean isAjaxEnabled()
+ {
+ return ajaxEnabled;
+ }
+
+ /**
+ * @see java.lang.Object#toString
+ */
+ public String toString()
+ {
+ return "PortalRenderSet: " + getAppId() + "." + (getName() ==
null ? "<from layout>" : getName()) + ": " +
+ getMediaType() + " [" + getRegionRenderer() + "][" +
getWindowRenderer() + "][" + getDecorationRenderer() +
+ "][" + getPortletRenderer() + "]";
+ }
+
+ private ObjectRenderer loadRenderer(ClassLoader loader, String className) throws
ClassNotFoundException, IllegalAccessException, InstantiationException
+ {
+ return (ObjectRenderer)loader.loadClass(className).newInstance();
+ }
+}
Property changes on: trunk/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/theme/src/main/org/jboss/portal/theme/PortalTheme.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/PortalTheme.java 2007-04-07 00:31:37 UTC
(rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/PortalTheme.java 2007-04-07 10:13:16 UTC
(rev 6942)
@@ -33,7 +33,7 @@
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.ObjectRenderer
+ * @see org.jboss.portal.theme.render.renderer.ObjectRenderer
* @see org.jboss.portal.theme.PortalLayout
*/
public abstract class PortalTheme
Modified: trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java 2007-04-07 00:31:37
UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java 2007-04-07 10:13:16
UTC (rev 6942)
@@ -30,22 +30,16 @@
*/
public final class ThemeConstants
{
+
private ThemeConstants()
{
}
- /** Request attribute to propagate the current portal theme in the request */
- public static final String ATTR_THEME = "THEME";
-
- /** Request attribute to propagate the theme service */
- public static final String ATTR_THEME_SERVER = "THEMESERVER";
-
// Portal property keys
/** Key name to access the selected layout for the portal or page (via the portal or
page properties) */
public static final String PORTAL_PROP_LAYOUT = "layout.id";
-
/** Key name to access the selected theme for the portal or page (via the portal or
page properties) */
public static final String PORTAL_PROP_THEME = "theme.id";
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-04-07 00:31:37
UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-04-07 10:13:16
UTC (rev 6942)
@@ -28,11 +28,12 @@
import org.jboss.portal.theme.page.PageResult;
import org.jboss.portal.theme.page.WindowContext;
import org.jboss.portal.theme.page.WindowResult;
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.PageRenderContext;
-import org.jboss.portal.theme.render.PageRenderer;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
+import org.jboss.portal.theme.render.renderer.PageRenderer;
import org.jboss.portal.theme.render.RenderException;
import org.jboss.portal.theme.render.RendererFactory;
+import org.jboss.portal.theme.render.ThemeContext;
import org.jboss.portal.WindowState;
import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.common.util.MarkupInfo;
@@ -53,24 +54,24 @@
public final class JSPLayout extends PortalLayout implements PageRenderer
{
- public RenderContext getRenderContext(MarkupInfo markupInfo, ServletContextDispatcher
dispatcher)
+ public RendererContext getRenderContext(ThemeContext themeContext, MarkupInfo
markupInfo, ServletContextDispatcher dispatcher)
{
RendererFactory factory = new RendererFactoryImpl(this, serviceInfo, info);
//
- return new JSPRenderContext(factory, dispatcher, markupInfo);
+ return new JSPRendererContext(themeContext, factory, dispatcher, markupInfo);
}
- public RenderContext getRenderContext(MarkupInfo markupInfo, ServletContextDispatcher
dispatcher, Writer writer)
+ public RendererContext getRenderContext(ThemeContext themeContext, MarkupInfo
markupInfo, ServletContextDispatcher dispatcher, Writer writer)
{
RendererFactory factory = new RendererFactoryImpl(this, serviceInfo, info);
//
- return new WriterRenderContext(factory, dispatcher, markupInfo, new
PrintWriter(writer));
+ return new WriterRendererContext(themeContext, factory, dispatcher, markupInfo, new
PrintWriter(writer));
}
- public void render(RenderContext renderContext, PageRenderContext prc) throws
RenderException
+ public void render(RendererContext rendererContext, PageRendererContext prc) throws
RenderException
{
PageResult pageResult = (PageResult)prc;
@@ -128,7 +129,7 @@
{
String layoutState = pageResult.getLayoutState();
String layoutURI = getLayoutInfo().getURI(layoutState);
- LayoutDispatcher dispatcher = new LayoutDispatcher(renderContext, prc,
layoutURI, getLayoutInfo());
+ LayoutDispatcher dispatcher = new LayoutDispatcher(rendererContext, prc,
layoutURI, getLayoutInfo());
dispatcher.include();
}
catch (IOException e)
Deleted: trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.impl;
-
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.RendererFactory;
-import org.jboss.portal.theme.render.ObjectRenderContext;
-import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.web.ServletContextDispatcher;
-import org.jboss.portal.common.util.MarkupInfo;
-
-import java.io.PrintWriter;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class JSPRenderContext extends RenderContext
-{
-
- /** The writer provided by the JSP tag lib, the tag lib will flush the writer at the
right time. */
- private PrintWriter writer;
-
- public JSPRenderContext(RendererFactory rendererFactory, ServletContextDispatcher
dispatcher, MarkupInfo markupInfo)
- {
- super(rendererFactory, dispatcher, markupInfo);
- }
-
- public PrintWriter getWriter()
- {
- return writer;
- }
-
- public void setWriter(PrintWriter writer)
- {
- this.writer = writer;
- }
-
- public void render(ObjectRenderContext ctx) throws RenderException,
IllegalStateException
- {
- super.render(ctx);
- }
-}
Copied: trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRendererContext.java (from rev
6941, trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRenderContext.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRendererContext.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/JSPRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.impl;
+
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.RendererFactory;
+import org.jboss.portal.theme.render.renderer.ObjectRendererContext;
+import org.jboss.portal.theme.render.RenderException;
+import org.jboss.portal.theme.render.ThemeContext;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.common.util.MarkupInfo;
+
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JSPRendererContext extends RendererContext
+{
+
+ /** The writer provided by the JSP tag lib, the tag lib will flush the writer at the
right time. */
+ private PrintWriter writer;
+
+ public JSPRendererContext(
+ ThemeContext themeContext,
+ RendererFactory rendererFactory,
+ ServletContextDispatcher dispatcher,
+ MarkupInfo markupInfo)
+ {
+ super(themeContext, rendererFactory, dispatcher, markupInfo);
+ }
+
+ public PrintWriter getWriter()
+ {
+ return writer;
+ }
+
+ public void setWriter(PrintWriter writer)
+ {
+ this.writer = writer;
+ }
+
+ public void render(ObjectRendererContext ctx) throws RenderException,
IllegalStateException
+ {
+ super.render(ctx);
+ }
+}
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -32,10 +32,10 @@
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ServerRegistrationID;
+import org.jboss.portal.theme.PortalRenderSet;
import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
import org.jboss.portal.theme.metadata.RenderSetMetaData;
import org.jboss.portal.theme.metadata.RendererSetMetaData;
-import org.jboss.portal.theme.render.PortalRenderSet;
import org.jboss.system.Service;
import java.util.ArrayList;
@@ -56,33 +56,35 @@
* @author <a href="mailto:mholzner@novell.com">Martin
Holzner</a>.
* @version <tt>$Revision$</tt>
* @see org.jboss.portal.theme.PortalLayout
- * @see org.jboss.portal.theme.render.PortalRenderSet
+ * @see org.jboss.portal.theme.PortalRenderSet
* @see MediaType
*/
public class LayoutServiceImpl extends AbstractJBossService implements LayoutService,
Service
{
private static Logger log = Logger.getLogger(LayoutServiceImpl.class);
- // map of layout id to layout
+ /** Map of layout id to layout. */
private Map layouts;
- // map of layout name to layout id
+ /** Map of layout name to layout id. */
private Map layoutNames;
- // map of appID + "." + layout name to layout id
+ /** Map of appID + "." + layout name to layout id. */
private Map exactLayoutNames;
- // map of renderSet registration id to list of rendersets
+ /** Map of renderSet registration id to list of rendersets. */
private Map renderSets;
- // map of render set name to render set
+ /** Map of render set name to render set. */
private Map renderSetNames;
- // map of appID + "." + render set name to render set
+ /** Map of appID + "." + render set name to render set. */
private Map exactRenderSetNames;
+ /** . */
private PortalLayout defaultLayout;
+ /** . */
private String defaultName;
public LayoutServiceImpl()
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/RendererFactoryImpl.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/RendererFactoryImpl.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/RendererFactoryImpl.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -23,16 +23,16 @@
package org.jboss.portal.theme.impl;
import org.jboss.portal.theme.render.RendererFactory;
-import org.jboss.portal.theme.render.ObjectRenderer;
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.ObjectRenderContext;
-import org.jboss.portal.theme.render.RegionRenderContext;
-import org.jboss.portal.theme.render.WindowRenderContext;
-import org.jboss.portal.theme.render.PortletRenderContext;
-import org.jboss.portal.theme.render.DecorationRenderContext;
-import org.jboss.portal.theme.render.PortalRenderSet;
-import org.jboss.portal.theme.render.PageRenderContext;
-import org.jboss.portal.theme.render.PageRenderer;
+import org.jboss.portal.theme.render.renderer.ObjectRenderer;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.renderer.ObjectRendererContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
+import org.jboss.portal.theme.render.renderer.PortletRendererContext;
+import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
+import org.jboss.portal.theme.render.renderer.PageRenderer;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
+import org.jboss.portal.theme.PortalRenderSet;
import org.jboss.portal.theme.LayoutServiceInfo;
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.LayoutInfo;
@@ -64,34 +64,34 @@
this.layoutInfo = layoutInfo;
}
- public ObjectRenderer getRenderer(RenderContext renderContext, ObjectRenderContext
objectRenderContext)
+ public ObjectRenderer getRenderer(RendererContext rendererContext,
ObjectRendererContext objectRendererContext)
{
- if (objectRenderContext instanceof PageRenderContext)
+ if (objectRendererContext instanceof PageRendererContext)
{
return pageRenderer;
}
- if (objectRenderContext instanceof RegionRenderContext)
+ if (objectRendererContext instanceof RegionRendererContext)
{
- return getRegionRenderer(renderContext,
(RegionRenderContext)objectRenderContext);
+ return getRegionRenderer(rendererContext,
(RegionRendererContext)objectRendererContext);
}
- else if (objectRenderContext instanceof WindowRenderContext)
+ else if (objectRendererContext instanceof WindowRendererContext)
{
- return getWindowRenderer(renderContext,
(WindowRenderContext)objectRenderContext);
+ return getWindowRenderer(rendererContext,
(WindowRendererContext)objectRendererContext);
}
- else if (objectRenderContext instanceof PortletRenderContext)
+ else if (objectRendererContext instanceof PortletRendererContext)
{
- return getPortletRenderer(renderContext,
(PortletRenderContext)objectRenderContext);
+ return getPortletRenderer(rendererContext,
(PortletRendererContext)objectRendererContext);
}
- else if (objectRenderContext instanceof DecorationRenderContext)
+ else if (objectRendererContext instanceof DecorationRendererContext)
{
- return getDecorationRenderer(renderContext,
(DecorationRenderContext)objectRenderContext);
+ return getDecorationRenderer(rendererContext,
(DecorationRendererContext)objectRendererContext);
}
return null;
}
- private ObjectRenderer getRegionRenderer(RenderContext renderContext,
RegionRenderContext objectRenderContext)
+ private ObjectRenderer getRegionRenderer(RendererContext rendererContext,
RegionRendererContext objectRenderContext)
{
- return getRenderSet(renderContext).getRegionRenderer();
+ return getRenderSet(rendererContext).getRegionRenderer();
}
/**
@@ -103,7 +103,7 @@
* name for the window renderer to use
* @return a window renderer
*/
- public ObjectRenderer getWindowRenderer(RenderContext renderContext,
WindowRenderContext result)
+ public ObjectRenderer getWindowRenderer(RendererContext rendererContext,
WindowRendererContext result)
{
String renderSetName = null;
if (result != null)
@@ -114,13 +114,13 @@
//
if (result != null && renderSetName == null)
{
- renderSetName =
renderContext.getProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
+ renderSetName =
rendererContext.getProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
}
//
if (renderSetName != null)
{
- PortalRenderSet renderSet = layoutServiceInfo.getRenderSet(renderSetName,
renderContext.getContentType());
+ PortalRenderSet renderSet = layoutServiceInfo.getRenderSet(renderSetName,
rendererContext.getContentType());
//
if (renderSet != null)
@@ -130,7 +130,7 @@
}
//
- return getRenderSet(renderContext).getWindowRenderer();
+ return getRenderSet(rendererContext).getWindowRenderer();
}
/**
@@ -142,7 +142,7 @@
* name for the decoration renderer to use
* @return a decoration renderer
*/
- public ObjectRenderer getDecorationRenderer(RenderContext renderContext,
DecorationRenderContext result)
+ public ObjectRenderer getDecorationRenderer(RendererContext rendererContext,
DecorationRendererContext result)
{
String renderSetName = null;
@@ -154,13 +154,13 @@
//
if (result != null && renderSetName == null)
{
- renderSetName =
renderContext.getProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
+ renderSetName =
rendererContext.getProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
}
//
if (renderSetName != null)
{
- PortalRenderSet renderSet = layoutServiceInfo.getRenderSet(renderSetName,
renderContext.getContentType());
+ PortalRenderSet renderSet = layoutServiceInfo.getRenderSet(renderSetName,
rendererContext.getContentType());
//
if (renderSet != null)
@@ -170,7 +170,7 @@
}
//
- return getRenderSet(renderContext).getDecorationRenderer();
+ return getRenderSet(rendererContext).getDecorationRenderer();
}
/**
@@ -182,7 +182,7 @@
* portlet renderer from
* @return a portlet renderer
*/
- public ObjectRenderer getPortletRenderer(RenderContext renderContext,
PortletRenderContext result)
+ public ObjectRenderer getPortletRenderer(RendererContext rendererContext,
PortletRendererContext result)
{
String renderSetName = null;
@@ -195,13 +195,13 @@
//
if (result != null && renderSetName == null)
{
- renderSetName =
renderContext.getProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
+ renderSetName =
rendererContext.getProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
}
//
if (renderSetName != null)
{
- PortalRenderSet renderSet = layoutServiceInfo.getRenderSet(renderSetName,
renderContext.getContentType());
+ PortalRenderSet renderSet = layoutServiceInfo.getRenderSet(renderSetName,
rendererContext.getContentType());
//
if (renderSet != null)
@@ -211,20 +211,20 @@
}
//
- return getRenderSet(renderContext).getPortletRenderer();
+ return getRenderSet(rendererContext).getPortletRenderer();
}
- private PortalRenderSet getRenderSet(RenderContext renderContext)
+ private PortalRenderSet getRenderSet(RendererContext rendererContext)
{
// Find the render set name
- String renderSetName =
renderContext.getProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
+ String renderSetName =
rendererContext.getProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
// if (renderSetName == null)
// {
// throw new IllegalArgumentException("No RenderSet determined");
// }
- ContentInfo contentInfo = renderContext.getMarkupInfo();
+ ContentInfo contentInfo = rendererContext.getMarkupInfo();
return layoutServiceInfo.getRenderSet(layoutInfo, contentInfo, renderSetName);
// if (renderSet == null)
Deleted: trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,68 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.impl;
-
-import org.jboss.portal.theme.render.RenderContext;
-import org.jboss.portal.theme.render.RendererFactory;
-import org.jboss.portal.theme.render.ObjectRenderContext;
-import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.web.ServletContextDispatcher;
-import org.jboss.portal.common.util.MarkupInfo;
-
-import java.io.PrintWriter;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WriterRenderContext extends RenderContext
-{
-
- /** The provided writer by the caller of the rendering process. */
- private final PrintWriter writer;
-
- public WriterRenderContext(
- RendererFactory rendererFactory,
- ServletContextDispatcher dispatcher,
- MarkupInfo markupInfo,
- PrintWriter writer)
- {
- super(rendererFactory, dispatcher, markupInfo);
-
- //
- this.writer = writer;
- }
-
- public PrintWriter getWriter()
- {
- return writer;
- }
-
- public void render(ObjectRenderContext ctx) throws RenderException,
IllegalStateException
- {
- super.render(ctx);
-
- //
- writer.flush();
- }
-}
Copied: trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRendererContext.java (from
rev 6941, trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRenderContext.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRendererContext.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/WriterRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.impl;
+
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.RendererFactory;
+import org.jboss.portal.theme.render.renderer.ObjectRendererContext;
+import org.jboss.portal.theme.render.RenderException;
+import org.jboss.portal.theme.render.ThemeContext;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.common.util.MarkupInfo;
+
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WriterRendererContext extends RendererContext
+{
+
+ /** The provided writer by the caller of the rendering process. */
+ private final PrintWriter writer;
+
+ public WriterRendererContext(
+ ThemeContext themeContext,
+ RendererFactory rendererFactory,
+ ServletContextDispatcher dispatcher,
+ MarkupInfo markupInfo,
+ PrintWriter writer)
+ {
+ super(themeContext, rendererFactory, dispatcher, markupInfo);
+
+ //
+ this.writer = writer;
+ }
+
+ public PrintWriter getWriter()
+ {
+ return writer;
+ }
+
+ public void render(ObjectRendererContext ctx) throws RenderException,
IllegalStateException
+ {
+ super.render(ctx);
+
+ //
+ writer.flush();
+ }
+}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -24,11 +24,11 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.theme.render.DecorationRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.DecorationRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.DecorationRenderContext;
-import org.jboss.portal.theme.render.ActionRenderContext;
+import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
+import org.jboss.portal.theme.render.renderer.ActionRendererContext;
import java.util.Collection;
import java.util.Collections;
@@ -44,23 +44,23 @@
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.DecorationRenderer
+ * @see org.jboss.portal.theme.render.renderer.DecorationRenderer
*/
public class DivDecorationRenderer
implements DecorationRenderer
{
- public void render(RenderContext renderContext, DecorationRenderContext drc) throws
RenderException
+ public void render(RendererContext rendererContext, DecorationRendererContext drc)
throws RenderException
{
- PrintWriter markup = renderContext.getWriter();
- renderTitle(renderContext, drc);
+ PrintWriter markup = rendererContext.getWriter();
+ renderTitle(rendererContext, drc);
markup.print("<div class=\"portlet-mode-container\">");
- renderModeAndStateLinks(renderContext, drc, ActionRenderContext.MODES_KEY);
- renderModeAndStateLinks(renderContext, drc, ActionRenderContext.WINDOWSTATES_KEY);
+ renderModeAndStateLinks(rendererContext, drc, ActionRendererContext.MODES_KEY);
+ renderModeAndStateLinks(rendererContext, drc,
ActionRendererContext.WINDOWSTATES_KEY);
markup.print("</div>");
}
- private static void renderTitle(RenderContext ctx, DecorationRenderContext drc)
+ private static void renderTitle(RendererContext ctx, DecorationRendererContext drc)
{
PrintWriter out = ctx.getWriter();
out.print("<div
class=\"portlet-titlebar-decoration\">");
@@ -69,7 +69,7 @@
out.print("</span></div>");
}
- private static void renderModeAndStateLinks(RenderContext ctx, DecorationRenderContext
drc, String selector)
+ private static void renderModeAndStateLinks(RendererContext ctx,
DecorationRendererContext drc, String selector)
{
Collection modesOrStates = drc.getTriggerableActions(selector);
if (modesOrStates == null)
@@ -86,7 +86,7 @@
for (Iterator i = modesOrStates.iterator(); i.hasNext();)
{
- ActionRenderContext action = (ActionRenderContext)i.next();
+ ActionRendererContext action = (ActionRendererContext)i.next();
if (action.isEnabled())
{
PrintWriter out = ctx.getWriter();
@@ -122,8 +122,8 @@
public int compare(Object o1, Object o2)
{
- ActionRenderContext action1 = (ActionRenderContext)o1;
- ActionRenderContext action2 = (ActionRenderContext)o2;
+ ActionRendererContext action1 = (ActionRendererContext)o1;
+ ActionRendererContext action2 = (ActionRendererContext)o2;
Object origin1 = action1.getFamily();
Object origin2 = action2.getFamily();
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivPortletRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivPortletRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivPortletRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.theme.impl.render.div;
-import org.jboss.portal.theme.render.PortletRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.PortletRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.PortletRenderContext;
+import org.jboss.portal.theme.render.renderer.PortletRendererContext;
import java.io.PrintWriter;
@@ -34,13 +34,13 @@
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortletRenderer
+ * @see org.jboss.portal.theme.render.renderer.PortletRenderer
*/
public class DivPortletRenderer implements PortletRenderer
{
- public void render(RenderContext renderContext, PortletRenderContext prc) throws
RenderException
+ public void render(RendererContext rendererContext, PortletRendererContext prc) throws
RenderException
{
- PrintWriter out = renderContext.getWriter();
+ PrintWriter out = rendererContext.getWriter();
out.print(prc.getMarkup());
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivRegionRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivRegionRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivRegionRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.theme.impl.render.div;
-import org.jboss.portal.theme.render.RegionRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.RegionRenderContext;
-import org.jboss.portal.theme.render.WindowRenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import java.util.Iterator;
import java.io.PrintWriter;
@@ -37,15 +37,15 @@
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @author <a href="mailto:roy@jboss.org>Roy Russo</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.RegionRenderer
+ * @see org.jboss.portal.theme.render.renderer.RegionRenderer
*/
public class DivRegionRenderer
implements RegionRenderer
{
- public void renderHeader(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderHeader(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
- PrintWriter markup = renderContext.getWriter();
+ PrintWriter markup = rendererContext.getWriter();
markup.print("<div");
if (rrc == null) // || region.getWindows().size() <= 0)
@@ -60,18 +60,18 @@
}
}
- public void renderBody(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderBody(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
for (Iterator i = rrc.getWindows().iterator(); i.hasNext();)
{
- WindowRenderContext wrc = (WindowRenderContext)i.next();
- renderContext.render(wrc);
+ WindowRendererContext wrc = (WindowRendererContext)i.next();
+ rendererContext.render(wrc);
}
}
- public void renderFooter(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderFooter(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
- PrintWriter markup = renderContext.getWriter();
+ PrintWriter markup = rendererContext.getWriter();
markup.print("</div>");
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivWindowRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivWindowRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivWindowRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.theme.impl.render.div;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.WindowRenderer;
-import org.jboss.portal.theme.render.WindowRenderContext;
+import org.jboss.portal.theme.render.renderer.WindowRenderer;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import java.io.PrintWriter;
@@ -34,27 +34,27 @@
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.WindowRenderer
+ * @see org.jboss.portal.theme.render.renderer.WindowRenderer
*/
public class DivWindowRenderer
implements WindowRenderer
{
- public void render(RenderContext renderContext, WindowRenderContext wrc) throws
RenderException
+ public void render(RendererContext rendererContext, WindowRendererContext wrc) throws
RenderException
{
- PrintWriter out = renderContext.getWriter();
+ PrintWriter out = rendererContext.getWriter();
out.print("<div class=\"portlet-container\">");
out.print("<table width=\"100%\" border=\"0\"
cellpadding=\"0\" cellspacing=\"0\">");
//
out.print("<tr><td
class=\"portlet-titlebar-left\"></td>");
out.print("<td class=\"portlet-titlebar-center\">");
- renderContext.render(wrc.getDecoration());
+ rendererContext.render(wrc.getDecoration());
out.print("</td><td
class=\"portlet-titlebar-right\"></td></tr>");
//
out.print("<tr><td
class=\"portlet-content-left\"></td>");
out.print("<td class=\"portlet-body\"><div
class=\"portlet-content-center\">");
- renderContext.render(wrc.getPortlet());
+ rendererContext.render(wrc.getPortlet());
out.print("</div></td><td
class=\"portlet-content-right\"></td></tr>");
//
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.theme.impl.render.dynamic;
-import org.jboss.portal.theme.render.DecorationRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.DecorationRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.DecorationRenderContext;
+import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
import java.io.PrintWriter;
@@ -35,7 +35,7 @@
* @author <a href="mailto:tomasz.szymanski@jboss.com">Tomasz
Szymanski</a>
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.DecorationRenderer
+ * @see org.jboss.portal.theme.render.renderer.DecorationRenderer
*/
public class DynaDecorationRenderer implements DecorationRenderer
{
@@ -49,23 +49,23 @@
delegate = decorationRenderer;
}
- public void render(RenderContext renderContext, DecorationRenderContext drc) throws
RenderException
+ public void render(RendererContext rendererContext, DecorationRendererContext drc)
throws RenderException
{
- switch(DynaStatus.get(renderContext))
+ switch(DynaStatus.get(rendererContext))
{
case DynaStatus.DYNA_RENDERED_VALUE:
DynaWindowRenderer.handleProvided.set(Boolean.TRUE);
//
- PrintWriter markup = renderContext.getWriter();
+ PrintWriter markup = rendererContext.getWriter();
markup.print("<div class=\"dyna-decoration\">\n");
markup.print("<div class=\"handle\">");
- delegate.render(renderContext, drc);
+ delegate.render(rendererContext, drc);
markup.print("</div>\n");
markup.print("</div>\n");
break;
case DynaStatus.CLASSIC_RENDERED_VALUE:
- delegate.render(renderContext, drc);
+ delegate.render(rendererContext, drc);
break;
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -23,10 +23,10 @@
package org.jboss.portal.theme.impl.render.dynamic;
-import org.jboss.portal.theme.render.PortletRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.PortletRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.PortletRenderContext;
+import org.jboss.portal.theme.render.renderer.PortletRendererContext;
import java.io.PrintWriter;
@@ -36,7 +36,7 @@
* @author <a href="mailto:tomasz.szymanski@jboss.com">Tomasz
Szymanski</a>
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortletRenderer
+ * @see org.jboss.portal.theme.render.renderer.PortletRenderer
*/
public class DynaPortletRenderer implements PortletRenderer
{
@@ -50,15 +50,15 @@
delegate = portletRenderer;
}
- /** @see PortletRenderer#render */
- public void render(RenderContext renderContext, PortletRenderContext prc) throws
RenderException
+ /** @see org.jboss.portal.theme.render.renderer.PortletRenderer#render */
+ public void render(RendererContext rendererContext, PortletRendererContext prc) throws
RenderException
{
- doDND(renderContext, prc);
+ doDND(rendererContext, prc);
}
- private void doDND(RenderContext renderContext, PortletRenderContext prc) throws
RenderException
+ private void doDND(RendererContext rendererContext, PortletRendererContext prc) throws
RenderException
{
- switch(DynaStatus.get(renderContext))
+ switch(DynaStatus.get(rendererContext))
{
case DynaStatus.DYNA_RENDERED_VALUE:
// Provide handle on content if needed
@@ -70,32 +70,32 @@
//
// StringBuffer out = renderContext.getMarkupFragment();
// out.append("<span class=\"handle\">");
- doCatchClicks(renderContext, prc);
+ doCatchClicks(rendererContext, prc);
// out.append("</span>");
}
else
{
- doCatchClicks(renderContext, prc);
+ doCatchClicks(rendererContext, prc);
}
break;
case DynaStatus.CLASSIC_RENDERED_VALUE:
- doCatchClicks(renderContext, prc);
+ doCatchClicks(rendererContext, prc);
break;
}
}
- private void doCatchClicks(RenderContext renderContext, PortletRenderContext prc)
throws RenderException
+ private void doCatchClicks(RendererContext rendererContext, PortletRendererContext
prc) throws RenderException
{
- switch(DynaStatus.get(renderContext))
+ switch(DynaStatus.get(rendererContext))
{
case DynaStatus.DYNA_RENDERED_VALUE:
- PrintWriter out = renderContext.getWriter();
+ PrintWriter out = rendererContext.getWriter();
out.print("<div class=\"dyna-portlet\">");
- delegate.render(renderContext, prc);
+ delegate.render(rendererContext, prc);
out.print("</div>");
break;
case DynaStatus.CLASSIC_RENDERED_VALUE:
- delegate.render(renderContext, prc);
+ delegate.render(rendererContext, prc);
break;
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRegionRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRegionRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRegionRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -45,10 +45,10 @@
package org.jboss.portal.theme.impl.render.dynamic;
-import org.jboss.portal.theme.render.RegionRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.RegionRenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
import java.io.PrintWriter;
@@ -57,7 +57,7 @@
*
* @author <a href="mailto:tomasz.szymanski@jboss.com">Tomasz
Szymanski</a>
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
- * @see org.jboss.portal.theme.render.RegionRenderer
+ * @see org.jboss.portal.theme.render.renderer.RegionRenderer
*/
public class DynaRegionRenderer implements RegionRenderer
{
@@ -72,15 +72,15 @@
delegate = regionRenderer;
}
- public void renderHeader(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderHeader(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
- PrintWriter markup = renderContext.getWriter();
- String jsBase = renderContext.getProperty(DynaConstants.DYNA_RESOURCE_BASE_URL);
- String asyncServerURL = renderContext.getProperty(DynaConstants.ASYNC_SERVER_URL);
- String viewState = renderContext.getProperty(DynaConstants.VIEW_STATE);
+ PrintWriter markup = rendererContext.getWriter();
+ String jsBase = rendererContext.getProperty(DynaConstants.DYNA_RESOURCE_BASE_URL);
+ String asyncServerURL =
rendererContext.getProperty(DynaConstants.ASYNC_SERVER_URL);
+ String viewState = rendererContext.getProperty(DynaConstants.VIEW_STATE);
//
- Object onPage = renderContext.getProperty(DynaConstants.OBJECT_ENABLED);
+ Object onPage = rendererContext.getProperty(DynaConstants.OBJECT_ENABLED);
boolean pageEnabled = onPage != null && "true".equals(onPage);
//
@@ -152,13 +152,13 @@
}
//
- renderContext.setAttribute(DynaConstants.DYNA_RENDER_STATUS, new Integer(status));
+ rendererContext.setAttribute(DynaConstants.DYNA_RENDER_STATUS, new
Integer(status));
//
switch(status)
{
case DynaStatus.DYNA_RENDERED_VALUE:
- delegate.renderHeader(renderContext, rrc);
+ delegate.renderHeader(rendererContext, rrc);
// We need height and width otherwise the region will not be usable when
empty
markup.print("<div class=\"dyna-region\"
id=\"");
@@ -166,30 +166,30 @@
markup.print("\">");
break;
case DynaStatus.CLASSIC_RENDERED_VALUE:
- delegate.renderHeader(renderContext, rrc);
+ delegate.renderHeader(rendererContext, rrc);
break;
case DynaStatus.NOT_RENDERED_VALUE:
break;
}
}
- public void renderFooter(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderFooter(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
- int status = DynaStatus.get(renderContext);
+ int status = DynaStatus.get(rendererContext);
//
- renderContext.setAttribute(DynaConstants.DYNA_RENDER_STATUS, null);
+ rendererContext.setAttribute(DynaConstants.DYNA_RENDER_STATUS, null);
//
switch(status)
{
case DynaStatus.DYNA_RENDERED_VALUE:
- PrintWriter markup = renderContext.getWriter();
+ PrintWriter markup = rendererContext.getWriter();
markup.print("</div>");
- delegate.renderFooter(renderContext, rrc);
+ delegate.renderFooter(rendererContext, rrc);
break;
case DynaStatus.CLASSIC_RENDERED_VALUE:
- delegate.renderFooter(renderContext, rrc);
+ delegate.renderFooter(rendererContext, rrc);
break;
case DynaStatus.NOT_RENDERED_VALUE:
break;
@@ -197,17 +197,17 @@
}
/**
- * @see RegionRenderer#renderBody
+ * @see org.jboss.portal.theme.render.renderer.RegionRenderer#renderBody
*/
- public void renderBody(RenderContext renderContext, final RegionRenderContext rrc)
throws RenderException
+ public void renderBody(RendererContext rendererContext, final RegionRendererContext
rrc) throws RenderException
{
- switch(DynaStatus.get(renderContext))
+ switch(DynaStatus.get(rendererContext))
{
case DynaStatus.DYNA_RENDERED_VALUE:
- delegate.renderBody(renderContext, rrc);
+ delegate.renderBody(rendererContext, rrc);
break;
case DynaStatus.CLASSIC_RENDERED_VALUE:
- delegate.renderBody(renderContext, rrc);
+ delegate.renderBody(rendererContext, rrc);
break;
case DynaStatus.NOT_RENDERED_VALUE:
break;
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaStatus.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaStatus.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaStatus.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.impl.render.dynamic;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.RendererContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -46,14 +46,14 @@
/** . */
public static final int NOT_RENDERED_VALUE = 4;
- public static int get(RenderContext renderContext)
+ public static int get(RendererContext rendererContext)
{
- Integer status =
(Integer)renderContext.getAttribute(DynaConstants.DYNA_RENDER_STATUS);
+ Integer status =
(Integer)rendererContext.getAttribute(DynaConstants.DYNA_RENDER_STATUS);
return status != null ? status.intValue() : UNKNOWN_VALUE;
}
- public static void set(RenderContext renderContext, int status)
+ public static void set(RendererContext rendererContext, int status)
{
- renderContext.setAttribute(DynaConstants.DYNA_RENDER_STATUS, INTEGERS[status]);
+ rendererContext.setAttribute(DynaConstants.DYNA_RENDER_STATUS, INTEGERS[status]);
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaWindowRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaWindowRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaWindowRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -23,10 +23,10 @@
package org.jboss.portal.theme.impl.render.dynamic;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.WindowRenderer;
-import org.jboss.portal.theme.render.WindowRenderContext;
+import org.jboss.portal.theme.render.renderer.WindowRenderer;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import java.io.PrintWriter;
@@ -36,7 +36,7 @@
* @author <a href="mailto:tomasz.szymanski@jboss.com">Tomasz
Szymanski</a>
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.WindowRenderer
+ * @see org.jboss.portal.theme.render.renderer.WindowRenderer
*/
public class DynaWindowRenderer implements WindowRenderer
{
@@ -53,21 +53,21 @@
delegate = windowRenderer;
}
- /** @see WindowRenderer#render */
- public void render(RenderContext renderContext, WindowRenderContext wrc) throws
RenderException
+ /** @see org.jboss.portal.theme.render.renderer.WindowRenderer#render */
+ public void render(RendererContext rendererContext, WindowRendererContext wrc) throws
RenderException
{
- switch(DynaStatus.get(renderContext))
+ switch(DynaStatus.get(rendererContext))
{
case DynaStatus.DYNA_RENDERED_VALUE:
// For now we say we have no provided any handle so far for the window
handleProvided.set(Boolean.FALSE);
//
- PrintWriter out = renderContext.getWriter();
+ PrintWriter out = rendererContext.getWriter();
out.print("<div class=\"dyna-window\"><div
id=\"");
out.print(wrc.getId());
out.print("\"/>\n");
- delegate.render(renderContext, wrc);
+ delegate.render(rendererContext, wrc);
out.print("</div></div>\n");
//
@@ -77,7 +77,7 @@
handleProvided.set(null);
//
- delegate.render(renderContext, wrc);
+ delegate.render(rendererContext, wrc);
break;
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyDecorationRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyDecorationRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyDecorationRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,22 +22,22 @@
******************************************************************************/
package org.jboss.portal.theme.impl.render.empty;
-import org.jboss.portal.theme.render.DecorationRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.DecorationRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.DecorationRenderContext;
+import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
/**
* Implementation of a Decoration renderer that creates no markup.
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.DecorationRenderer
+ * @see org.jboss.portal.theme.render.renderer.DecorationRenderer
*/
public class EmptyDecorationRenderer
implements DecorationRenderer
{
- public void render(RenderContext renderContext, DecorationRenderContext drc) throws
RenderException
+ public void render(RendererContext rendererContext, DecorationRendererContext drc)
throws RenderException
{
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyPortletRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyPortletRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyPortletRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,23 +22,23 @@
******************************************************************************/
package org.jboss.portal.theme.impl.render.empty;
-import org.jboss.portal.theme.render.PortletRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.PortletRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.PortletRenderContext;
+import org.jboss.portal.theme.render.renderer.PortletRendererContext;
/**
* Implementation of a Portlet renderer that create only the portlet content, no markup
around it.
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortletRenderer
+ * @see org.jboss.portal.theme.render.renderer.PortletRenderer
*/
public class EmptyPortletRenderer
implements PortletRenderer
{
- public void render(RenderContext renderContext, PortletRenderContext prc) throws
RenderException
+ public void render(RendererContext rendererContext, PortletRendererContext prc) throws
RenderException
{
- renderContext.getWriter().print(prc.getMarkup());
+ rendererContext.getWriter().print(prc.getMarkup());
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyRegionRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyRegionRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyRegionRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -23,11 +23,11 @@
package org.jboss.portal.theme.impl.render.empty;
import org.jboss.logging.Logger;
-import org.jboss.portal.theme.render.RegionRenderer;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRenderer;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.RegionRenderContext;
-import org.jboss.portal.theme.render.WindowRenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import java.util.Iterator;
import java.util.Map;
@@ -39,7 +39,7 @@
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.RegionRenderer
+ * @see org.jboss.portal.theme.render.renderer.RegionRenderer
*/
public class EmptyRegionRenderer
implements RegionRenderer
@@ -47,33 +47,33 @@
private static Logger log = Logger.getLogger(EmptyRegionRenderer.class);
- public void renderHeader(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderHeader(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
}
- public void renderFooter(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderFooter(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
}
/** @see RegionRenderer#renderBody */
- public void renderBody(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException
+ public void renderBody(RendererContext rendererContext, RegionRendererContext rrc)
throws RenderException
{
Map orderedItems = new TreeMap();
//
for (Iterator i = rrc.getWindows().iterator(); i.hasNext();)
{
- WindowRenderContext window = (WindowRenderContext)i.next();
+ WindowRendererContext window = (WindowRendererContext)i.next();
orderedItems.put(new Integer(window.getOrder()), window);
}
//
for (Iterator i = orderedItems.values().iterator(); i.hasNext();)
{
- WindowRenderContext wrc = (WindowRenderContext)i.next();
- renderContext.render(wrc);
+ WindowRendererContext wrc = (WindowRendererContext)i.next();
+ rendererContext.render(wrc);
}
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyWindowRenderer.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyWindowRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyWindowRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,24 +22,22 @@
******************************************************************************/
package org.jboss.portal.theme.impl.render.empty;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.WindowRenderer;
-import org.jboss.portal.theme.render.WindowRenderContext;
-import org.jboss.portal.theme.render.PortletRenderContext;
+import org.jboss.portal.theme.render.renderer.WindowRenderer;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
/**
* Implementation of a Window renderer that creates no markup, and only passed control to
the Portlet renderer.
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.WindowRenderer
+ * @see org.jboss.portal.theme.render.renderer.WindowRenderer
*/
public class EmptyWindowRenderer implements WindowRenderer
{
- public void render(RenderContext renderContext, WindowRenderContext wrc) throws
RenderException
+ public void render(RendererContext rendererContext, WindowRendererContext wrc) throws
RenderException
{
- renderContext.render(wrc.getPortlet());
+ rendererContext.render(wrc.getPortlet());
}
}
Deleted:
trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRenderContextImpl.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRenderContextImpl.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRenderContextImpl.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,62 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.page;
-
-import org.jboss.portal.theme.render.DecorationRenderContext;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class DecorationRenderContextImpl implements DecorationRenderContext
-{
-
- final WindowContext wrc;
-
- public DecorationRenderContextImpl(WindowContext wrc)
- {
- this.wrc = wrc;
- }
-
- public String getId()
- {
- return wrc.getId();
- }
-
- public String getTitle()
- {
- return wrc.result.getTitle();
- }
-
- public Collection getTriggerableActions(String familyName)
- {
- return wrc.result.getTriggerableActions(familyName);
- }
-
- public String getProperty(String name)
- {
- return wrc.getProperty(name);
- }
-}
Copied:
trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRendererContextImpl.java (from
rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRenderContextImpl.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRendererContextImpl.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/page/DecorationRendererContextImpl.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.page;
+
+import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DecorationRendererContextImpl implements DecorationRendererContext
+{
+
+ final WindowContext wrc;
+
+ public DecorationRendererContextImpl(WindowContext wrc)
+ {
+ this.wrc = wrc;
+ }
+
+ public String getId()
+ {
+ return wrc.getId();
+ }
+
+ public String getTitle()
+ {
+ return wrc.result.getTitle();
+ }
+
+ public Collection getTriggerableActions(String familyName)
+ {
+ return wrc.result.getTriggerableActions(familyName);
+ }
+
+ public String getProperty(String name)
+ {
+ return wrc.getProperty(name);
+ }
+}
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/PageRendition.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/PageRendition.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/PageRendition.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -23,10 +23,11 @@
package org.jboss.portal.theme.page;
import org.jboss.portal.theme.PageService;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.RenderException;
+import org.jboss.portal.theme.render.ThemeContext;
import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.PortalTheme;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.web.ServletContextDispatcher;
@@ -47,14 +48,19 @@
private PageResult pageResult;
/** . */
+ private PortalTheme theme;
+
+ /** . */
private PageService pageService;
public PageRendition(
PortalLayout layout,
+ PortalTheme theme,
PageResult markupResult,
PageService pageService)
{
this.layout = layout;
+ this.theme = theme;
this.pageResult = markupResult;
this.pageService = pageService;
}
@@ -62,29 +68,20 @@
/** Performs the page rendition. */
public void render(MarkupInfo markupInfo, ServletContextDispatcher dispatcher) throws
IOException, ServletException
{
+ ThemeContext themeContext = new ThemeContext(theme,
pageService.getThemeService());
+
//
- RenderContext renderContext = layout.getRenderContext(markupInfo, dispatcher);
+ RendererContext rendererContext = layout.getRenderContext(themeContext, markupInfo,
dispatcher);
//
try
{
- // Place a reference to the theme service into the request so that the theme tag
can get to a theme via a theme
- // name (specified as tag attribute); this is useful if no theme was defined for
the portal or the page
- renderContext.setAttribute(ThemeConstants.ATTR_THEME_SERVER,
pageService.getThemeService());
- renderContext.setAttribute(ThemeConstants.ATTR_THEME, pageResult.getTheme());
-
- //
- renderContext.render(pageResult);
+ rendererContext.render(pageResult);
}
catch (RenderException e)
{
e.printStackTrace();
}
- finally
- {
- renderContext.setAttribute(ThemeConstants.ATTR_THEME_SERVER, null);
- renderContext.setAttribute(ThemeConstants.ATTR_THEME, null);
- }
}
public PageResult getPageResult()
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java 2007-04-07 00:31:37
UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java 2007-04-07 10:13:16
UTC (rev 6942)
@@ -22,11 +22,10 @@
******************************************************************************/
package org.jboss.portal.theme.page;
-import org.jboss.portal.theme.render.PortalRenderSet;
-import org.jboss.portal.theme.render.PageRenderContext;
-import org.jboss.portal.theme.render.RegionRenderContext;
-import org.jboss.portal.theme.render.WindowRenderContext;
-import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.theme.PortalRenderSet;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import java.util.HashMap;
import java.util.Map;
@@ -41,7 +40,7 @@
* @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
* @version $Revision$
*/
-public class PageResult implements PageRenderContext
+public class PageResult implements PageRendererContext
{
/** . */
@@ -66,9 +65,6 @@
protected PortalRenderSet renderSet;
/** . */
- protected PortalTheme theme;
-
- /** . */
final Map regions;
public PageResult(String pageName, Map pageProperties, Map portalProperties)
@@ -87,16 +83,6 @@
this(pageName, new HashMap(), new HashMap());
}
- public PortalTheme getTheme()
- {
- return theme;
- }
-
- public void setTheme(PortalTheme theme)
- {
- this.theme = theme;
- }
-
/**
* Get a reference to the region object for the provided region name.
*
@@ -165,7 +151,7 @@
return windowContexts.keySet();
}
- public WindowRenderContext getWindow(String windowId)
+ public WindowRendererContext getWindow(String windowId)
{
return getWindowContext(windowId);
}
@@ -230,9 +216,9 @@
return regions.values();
}
- public RegionRenderContext getRegion(String regionName)
+ public RegionRendererContext getRegion(String regionName)
{
- return (RegionRenderContext)regions.get(regionName);
+ return (RegionRendererContext)regions.get(regionName);
}
public void rebuild()
Deleted: trunk/theme/src/main/org/jboss/portal/theme/page/PortletRenderContextImpl.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/page/PortletRenderContextImpl.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/page/PortletRenderContextImpl.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,61 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.page;
-
-import org.jboss.portal.theme.render.PortletRenderContext;
-import org.jboss.portal.theme.render.WindowRenderContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletRenderContextImpl implements PortletRenderContext
-{
-
- final WindowContext wrc;
-
- public PortletRenderContextImpl(WindowContext wrc)
- {
- this.wrc = wrc;
- }
-
- public String getMarkup()
- {
- return wrc.result.getContent();
- }
-
- public String getProperty(String name)
- {
- return wrc.getProperty(name);
- }
-
- public String getProperty(String name, int scope)
- {
- return getProperty(name);
- }
-
- public WindowRenderContext getWindow()
- {
- return wrc;
- }
-}
Copied: trunk/theme/src/main/org/jboss/portal/theme/page/PortletRendererContextImpl.java
(from rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/page/PortletRenderContextImpl.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/PortletRendererContextImpl.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/page/PortletRendererContextImpl.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.page;
+
+import org.jboss.portal.theme.render.renderer.PortletRendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletRendererContextImpl implements PortletRendererContext
+{
+
+ final WindowContext wrc;
+
+ public PortletRendererContextImpl(WindowContext wrc)
+ {
+ this.wrc = wrc;
+ }
+
+ public String getMarkup()
+ {
+ return wrc.result.getContent();
+ }
+
+ public String getProperty(String name)
+ {
+ return wrc.getProperty(name);
+ }
+
+ public String getProperty(String name, int scope)
+ {
+ return getProperty(name);
+ }
+
+ public WindowRendererContext getWindow()
+ {
+ return wrc;
+ }
+}
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/Region.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/Region.java 2007-04-07 00:31:37 UTC
(rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/Region.java 2007-04-07 10:13:16 UTC
(rev 6942)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.page;
-import org.jboss.portal.theme.render.RegionRenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
import org.jboss.portal.theme.Orientation;
import java.util.ArrayList;
@@ -39,7 +39,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public final class Region implements RegionRenderContext
+public final class Region implements RegionRendererContext
{
/** . */
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.theme.page;
-import org.jboss.portal.theme.render.WindowRenderContext;
-import org.jboss.portal.theme.render.DecorationRenderContext;
-import org.jboss.portal.theme.render.PortletRenderContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
+import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
+import org.jboss.portal.theme.render.renderer.PortletRendererContext;
import org.jboss.portal.WindowState;
import org.jboss.portal.Mode;
@@ -39,7 +39,7 @@
* @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
* @version $Revision$
*/
-public final class WindowContext implements Comparable, Serializable,
WindowRenderContext
+public final class WindowContext implements Comparable, Serializable,
WindowRendererContext
{
/** The serialVersionUID */
@@ -52,10 +52,10 @@
private final String name;
/** . */
- private final DecorationRenderContextImpl decoration = new
DecorationRenderContextImpl(this);
+ private final DecorationRendererContextImpl decoration = new
DecorationRendererContextImpl(this);
/** . */
- private final PortletRenderContextImpl portlet = new PortletRenderContextImpl(this);
+ private final PortletRendererContextImpl portlet = new
PortletRendererContextImpl(this);
// Mutable properties
@@ -107,12 +107,12 @@
return result.getMode();
}
- public DecorationRenderContext getDecoration()
+ public DecorationRendererContext getDecoration()
{
return decoration;
}
- public PortletRenderContext getPortlet()
+ public PortletRendererContext getPortlet()
{
return portlet;
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/WindowResult.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/WindowResult.java 2007-04-07 00:31:37
UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/WindowResult.java 2007-04-07 10:13:16
UTC (rev 6942)
@@ -24,7 +24,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.theme.render.ActionRenderContext;
+import org.jboss.portal.theme.render.renderer.ActionRendererContext;
import org.jboss.portal.portlet.Properties;
import java.util.Collection;
@@ -157,7 +157,7 @@
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
*/
- public static class Action implements ActionRenderContext
+ public static class Action implements ActionRendererContext
{
/** The origin of the action. */
private final String family;
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/ActionRenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/ActionRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/ActionRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,44 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface ActionRenderContext extends ObjectRenderContext
-{
- /** . */
- String MODES_KEY = "mode";
- /** . */
- String WINDOWSTATES_KEY = "windowstate";
-
- String getName();
-
- String getFamily();
-
- String getURL();
-
- boolean isEnabled();
-
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderContext.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,39 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface DecorationRenderContext extends ObjectRenderContext
-{
-
- String getId();
-
- String getTitle();
-
- Collection getTriggerableActions(String familyName);
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,49 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-/**
- * A decoration renderer is responsible for generating the markup of the portlet window
title bar. <p>The decoration
- * renderer has the responsibility to create the title , the window state links, and the
portlet mode links. It is
- * intended to be called by the <code>WindowRenderer</code> to produce part
of the markup of a portlet wiindow. The
- * other parts are intended to be created by the
<code>PortletRenderer</code>, and the <code>WindowRenderer</code>
- * itself.</p>
- *
- * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
- * @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortalRenderSet
- * @see WindowRenderer
- * @see PortletRenderer
- */
-public interface DecorationRenderer extends ObjectRenderer
-{
- /**
- * Create the markup for the portlet decoration
- *
- * @param renderContext the state holder to provide information about the region,
it's portlets, and the render set,
- * which allows access to the other renderer interfaces of the
render set.
- * @throws RenderException
- */
- void render(RenderContext renderContext, DecorationRenderContext drc) throws
RenderException;
-
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,32 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface ObjectRenderContext
-{
- String getProperty(String name);
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,34 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-/**
- * Generic renderer interface extended by all members of a render set.
- *
- * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
- * @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortalRenderSet
- */
-public interface ObjectRenderer
-{
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface PageRenderContext extends ObjectRenderContext
-{
- Collection getRegions();
-
- RegionRenderContext getRegion(String regionName);
-
- WindowRenderContext getWindow(String windowId);
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,32 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface PageRenderer extends ObjectRenderer
-{
- void render(RenderContext renderContext, PageRenderContext prc) throws
RenderException;
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,186 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.theme.RuntimeContext;
-import org.jboss.portal.theme.ServerRegistrationID;
-import org.jboss.portal.theme.impl.render.dynamic.DynaDecorationRenderer;
-import org.jboss.portal.theme.impl.render.dynamic.DynaPortletRenderer;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRegionRenderer;
-import org.jboss.portal.theme.impl.render.dynamic.DynaWindowRenderer;
-import org.jboss.portal.theme.metadata.RendererSetMetaData;
-
-/**
- * The portal render set is a set of renderer implementations for the markup container of
a page. <p>A render set
- * consists of 4 iterface implementations with some meta data describing the web
application the render set is coming
- * from, and the content type it is capable of handling.</p>
- *
- * @author <a href="mailto:mholzner@novell.com">Martin
Holzner</a>.
- * @version <tt>$Revision$</tt>
- */
-public final class PortalRenderSet
-{
-
- private final RegionRenderer regionRenderer;
- private final WindowRenderer windowRenderer;
- private final PortletRenderer portletRenderer;
- private final DecorationRenderer decorationRenderer;
- private final MediaType contentType;
- private final String appID;
- private final String name;
- private final ServerRegistrationID registrationId;
- private final boolean ajaxEnabled;
-
- /**
- * construct a render set
- *
- * @param renderSetName the name of the render set as defined in the
portal-renderSet.xml descriptor, or null if it
- * was defined as part of a layout descriptor.
- * @param runtimeContext the runtime environment (data describing the portal web
application in wich the render set
- * was defined)
- * @param rendererSetMD meta data about an individual set of 4 renderer
implementation together with their supported
- * content type
- * @throws IllegalAccessException
- * @throws InstantiationException
- * @throws ClassNotFoundException
- */
- public PortalRenderSet(String renderSetName, RuntimeContext runtimeContext,
RendererSetMetaData rendererSetMD) throws IllegalAccessException, InstantiationException,
ClassNotFoundException
- {
- // there CAN be render sets without a name !
-
- if (runtimeContext == null)
- {
- throw new IllegalArgumentException("no valid container");
- }
- if (rendererSetMD == null)
- {
- throw new IllegalArgumentException("no valid set");
- }
- this.name = renderSetName;
- this.appID = runtimeContext.getAppId();
- this.registrationId =
ServerRegistrationID.createID(ServerRegistrationID.TYPE_RENDERSET, new String[]{appID,
name});
- this.contentType = rendererSetMD.getContentType();
- this.ajaxEnabled = rendererSetMD.isAjaxEnabled();
-
- if (ajaxEnabled) // wrap the current renderer with the ajax delegator one.
- {
- this.regionRenderer = new
DynaRegionRenderer((RegionRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getRegionRenderer()));
- this.windowRenderer = new
DynaWindowRenderer((WindowRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getWindowRenderer()));
- this.portletRenderer = new
DynaPortletRenderer((PortletRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getPortletRenderer()));
- this.decorationRenderer = new
DynaDecorationRenderer((DecorationRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getDecorationRenderer()));
- }
- else
- {
- this.regionRenderer =
(RegionRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getRegionRenderer());
- this.windowRenderer =
(WindowRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getWindowRenderer());
- this.portletRenderer =
(PortletRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getPortletRenderer());
- this.decorationRenderer =
(DecorationRenderer)loadRenderer(runtimeContext.getClassLoader(),
rendererSetMD.getDecorationRenderer());
- }
- }
-
- public ServerRegistrationID getRegistrationId()
- {
- return registrationId;
- }
-
- /**
- * @see PortalRenderSet#getMediaType
- */
- public MediaType getMediaType()
- {
- return contentType;
- }
-
- /**
- * Get the name of the application (the WAR) that contains this render set.
- *
- * @return the name of the application (the WAR) that contains this render set
- */
- public String getAppId()
- {
- return appID;
- }
-
- /**
- * Get the name of this render set.
- *
- * @return the name of this render set
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * @see PortalRenderSet#getRegionRenderer
- */
- public RegionRenderer getRegionRenderer()
- {
- return regionRenderer;
- }
-
- /**
- * @see PortalRenderSet#getWindowRenderer
- */
- public WindowRenderer getWindowRenderer()
- {
- return windowRenderer;
- }
-
- /**
- * @see org.jboss.portal.theme.render.PortalRenderSet#getPortletRenderer
- */
- public PortletRenderer getPortletRenderer()
- {
- return portletRenderer;
- }
-
- /**
- * @see PortalRenderSet#getDecorationRenderer
- */
- public DecorationRenderer getDecorationRenderer()
- {
- return decorationRenderer;
- }
-
- public boolean isAjaxEnabled()
- {
- return ajaxEnabled;
- }
-
- /**
- * @see java.lang.Object#toString
- */
- public String toString()
- {
- return "PortalRenderSet: " + getAppId() + "." + (getName() ==
null ? "<from layout>" : getName()) + ": " +
- getMediaType() + " [" + getRegionRenderer() + "][" +
getWindowRenderer() + "][" + getDecorationRenderer() +
- "][" + getPortletRenderer() + "]";
- }
-
- private ObjectRenderer loadRenderer(ClassLoader loader, String className) throws
ClassNotFoundException, IllegalAccessException, InstantiationException
- {
- return (ObjectRenderer)loader.loadClass(className).newInstance();
- }
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderContext.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,34 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface PortletRenderContext extends ObjectRenderContext
-{
-
- String getMarkup();
-
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,51 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-/**
- * The portlet renderer is responsible for adding the created markup of a portlet to the
page. <p>The portlet renderer
- * is intended to be called by the <code>WindowRenderer</code> as part of the
generation of the markup for a portlet
- * window. The portlet renderer is not responsible for generating the decoration markup,
like the title. The
- * <code>DecorationRenderer</code> is responsible for that. It is also called
by the <code>WindowRenderer</code> as part
- * of the render process for one portlet window.</p>
- *
- * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
- * @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortalRenderSet
- * @see WindowRenderer
- * @see DecorationRenderer
- */
-public interface PortletRenderer
- extends ObjectRenderer
-{
- /**
- * Render the markup of a portlet. <p>Note: this is not calling the portlet
container to produce the markup. The
- * markup has already been created. The PortletRenderer only places the markup on the
page, and can gnerate some
- * containing markup around it if it chooses to do so</p>.
- *
- * @param renderContext the state holder to provide information about the region,
it's portlets, and the render set,
- * which allows access to the other renderer interfaces of the
render set.
- * @throws RenderException
- */
- void render(RenderContext renderContext, PortletRenderContext prc) throws
RenderException;
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,43 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-import org.jboss.portal.theme.Orientation;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface RegionRenderContext extends ObjectRenderContext
-{
-
- String getId();
-
- Collection getWindows();
-
- Orientation getOrientation();
-
- String getCSSId();
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,45 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-/**
- * A region renderer is responsible to create the markup container for a set of portlets
on a page region. <p>The
- * Portlets on a portal page can be assigned to regions of that page. Regions are sub
elements of a page, that will be
- * used by a layout to position groups of portlets over the areas of the page. The region
renderer can be invoked to
- * render the entire content of the region. It is assumed to take over the responsibility
of delegating to the
- * <code>WindowRenderer</code> for each portlet that needs to be rendered in
the region in question.</p>
- *
- * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
- * @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortalRenderSet
- * @see WindowRenderer
- */
-public interface RegionRenderer
- extends ObjectRenderer
-{
- void renderBody(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException;
-
- void renderHeader(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException;
-
- void renderFooter(RenderContext renderContext, RegionRenderContext rrc) throws
RenderException;
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,209 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.web.ServletContextDispatcher;
-
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.io.PrintWriter;
-
-/**
- * A render context to render a context on a page. <p>A render context is scoped to
a MarkupContainer (a region, or a
- * window). A render context that is not scoped to a MarkupContainer is ment to be a page
level template to allow easier
- * creation of the region and window render contexts via the
<code>RenderContext.getContext()</code> methods.</p>
- *
- * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
- * @version $LastChangedRevision$, $LastChangedDate$
- */
-public abstract class RenderContext
-{
-
- /** . */
- private RendererFactory rendererFactory;
-
- /** . */
- private ServletContextDispatcher dispatcher;
-
- /** . */
- private MarkupInfo markupInfo;
-
- /** . */
- private ArrayList stack;
-
- /** . */
- private Map attributes;
-
- /**
- * Create a new render context for the provided result. <p>The result contains
information about the markup container
- * (page, region , window context) to render.</p>
- */
- public RenderContext(
- RendererFactory rendererFactory,
- ServletContextDispatcher dispatcher,
- MarkupInfo markupInfo)
- {
- if (rendererFactory == null)
- {
- throw new IllegalArgumentException("no renderer factory provided");
- }
- if (dispatcher == null)
- {
- throw new IllegalArgumentException("no server invocation provided");
- }
- if (markupInfo == null)
- {
- throw new IllegalArgumentException("no stream info provided");
- }
-
- this.rendererFactory = rendererFactory;
- this.dispatcher = dispatcher;
- this.markupInfo = markupInfo;
- this.stack = new ArrayList(6);
- this.attributes = new HashMap();
- }
-
- public abstract PrintWriter getWriter();
-
- public ServletContextDispatcher getDispatcher()
- {
- return dispatcher;
- }
-
- public MarkupInfo getMarkupInfo()
- {
- return markupInfo;
- }
-
- public MediaType getContentType()
- {
- return markupInfo.getContentType();
- }
-
- public String getCharset()
- {
- return markupInfo.getCharset();
- }
-
- public Object getAttribute(String attrName)
- {
- if (attrName == null)
- {
- throw new IllegalArgumentException("No null attribute name");
- }
- return attributes.get(attrName);
- }
-
- public void setAttribute(String attrName, Object attrValue)
- {
- if (attrName == null)
- {
- throw new IllegalArgumentException("No null attribute name");
- }
- if (attrValue != null)
- {
- attributes.put(attrName, attrValue);
- }
- else
- {
- attributes.remove(attrName);
- }
- }
-
- public String getProperty(String propertyName)
- {
- for (int i = stack.size() - 1;i >= 0;i--)
- {
- ObjectRenderContext ctx = (ObjectRenderContext)stack.get(i);
- String propertyValue = ctx.getProperty(propertyName);
- if (propertyValue != null)
- {
- return propertyValue;
- }
- }
- return null;
- }
-
- public void pushObjectRenderContext(ObjectRenderContext ctx)
- {
- stack.add(ctx);
- }
-
- public ObjectRenderContext popObjectRenderContext()
- {
- return (ObjectRenderContext)stack.remove(stack.size() - 1);
- }
-
- public void render(ObjectRenderContext ctx) throws RenderException,
IllegalStateException
- {
- pushObjectRenderContext(ctx);
-
- //
- try
- {
- if (ctx instanceof PageRenderContext)
- {
- PageRenderContext prc = (PageRenderContext)ctx;
- PageRenderer renderer = (PageRenderer)rendererFactory.getRenderer(this,
prc);
- renderer.render(this, prc);
- }
- if (ctx instanceof WindowRenderContext)
- {
- WindowRenderContext wrc = (WindowRenderContext)ctx;
- WindowRenderer renderer = (WindowRenderer)rendererFactory.getRenderer(this,
wrc);
- renderer.render(this, wrc);
- }
- else if (ctx instanceof RegionRenderContext)
- {
- RegionRenderContext rrc = (RegionRenderContext)ctx;
- RegionRenderer renderer = (RegionRenderer)rendererFactory.getRenderer(this,
rrc);
-
- //
- renderer.renderHeader(this, rrc);
- renderer.renderBody(this, rrc);
- renderer.renderFooter(this, rrc);
- }
- else if (ctx instanceof PortletRenderContext)
- {
- PortletRenderContext prc = (PortletRenderContext)ctx;
- PortletRenderer renderer = (PortletRenderer)rendererFactory.getRenderer(this,
prc);
- renderer.render(this, prc);
- }
- else if (ctx instanceof DecorationRenderContext)
- {
- DecorationRenderContext drc = (DecorationRenderContext)ctx;
- DecorationRenderer renderer =
(DecorationRenderer)rendererFactory.getRenderer(this, drc);
-
- //
- renderer.render(this, drc);
- }
- }
- finally
- {
- popObjectRenderContext();
- }
- }
-}
\ No newline at end of file
Added: trunk/theme/src/main/org/jboss/portal/theme/render/RendererContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/RendererContext.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/RendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,233 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render;
+
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
+import org.jboss.portal.theme.render.renderer.DecorationRenderer;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
+import org.jboss.portal.theme.render.renderer.ObjectRendererContext;
+import org.jboss.portal.theme.render.renderer.RegionRenderer;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
+import org.jboss.portal.theme.render.renderer.PortletRendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRenderer;
+import org.jboss.portal.theme.render.renderer.PortletRenderer;
+import org.jboss.portal.theme.render.renderer.PageRenderer;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.io.PrintWriter;
+
+/**
+ * A render context to render a context on a page. <p>A render context is scoped to
a MarkupContainer (a region, or a
+ * window). A render context that is not scoped to a MarkupContainer is ment to be a page
level template to allow easier
+ * creation of the region and window render contexts via the
<code>RenderContext.getContext()</code> methods.</p>
+ *
+ * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
+ * @version $LastChangedRevision: 6934 $, $LastChangedDate: 2007-04-06 16:30:52 +0200
(Fri, 06 Apr 2007) $
+ */
+public abstract class RendererContext
+{
+
+ private final ThemeContext themeContext;
+
+ /** . */
+ private final RendererFactory rendererFactory;
+
+ /** . */
+ private final ServletContextDispatcher dispatcher;
+
+ /** . */
+ private final MarkupInfo markupInfo;
+
+ /** . */
+ private final ArrayList stack;
+
+ /** . */
+ private final Map attributes;
+
+ /**
+ * Create a new render context for the provided result. <p>The result contains
information about the markup container
+ * (page, region , window context) to render.</p>
+ */
+ public RendererContext(
+ ThemeContext themeContext,
+ RendererFactory rendererFactory,
+ ServletContextDispatcher dispatcher,
+ MarkupInfo markupInfo)
+ {
+ if (themeContext == null)
+ {
+ throw new IllegalArgumentException("no theme factory provided");
+ }
+ if (rendererFactory == null)
+ {
+ throw new IllegalArgumentException("no renderer factory provided");
+ }
+ if (dispatcher == null)
+ {
+ throw new IllegalArgumentException("no server invocation provided");
+ }
+ if (markupInfo == null)
+ {
+ throw new IllegalArgumentException("no stream info provided");
+ }
+
+ this.themeContext = themeContext;
+ this.rendererFactory = rendererFactory;
+ this.dispatcher = dispatcher;
+ this.markupInfo = markupInfo;
+ this.stack = new ArrayList(6);
+ this.attributes = new HashMap();
+ }
+
+ public abstract PrintWriter getWriter();
+
+ public ThemeContext getThemeContext()
+ {
+ return themeContext;
+ }
+
+ public ServletContextDispatcher getDispatcher()
+ {
+ return dispatcher;
+ }
+
+ public MarkupInfo getMarkupInfo()
+ {
+ return markupInfo;
+ }
+
+ public MediaType getContentType()
+ {
+ return markupInfo.getContentType();
+ }
+
+ public String getCharset()
+ {
+ return markupInfo.getCharset();
+ }
+
+ public Object getAttribute(String attrName)
+ {
+ if (attrName == null)
+ {
+ throw new IllegalArgumentException("No null attribute name");
+ }
+ return attributes.get(attrName);
+ }
+
+ public void setAttribute(String attrName, Object attrValue)
+ {
+ if (attrName == null)
+ {
+ throw new IllegalArgumentException("No null attribute name");
+ }
+ if (attrValue != null)
+ {
+ attributes.put(attrName, attrValue);
+ }
+ else
+ {
+ attributes.remove(attrName);
+ }
+ }
+
+ public String getProperty(String propertyName)
+ {
+ for (int i = stack.size() - 1;i >= 0;i--)
+ {
+ ObjectRendererContext ctx = (ObjectRendererContext)stack.get(i);
+ String propertyValue = ctx.getProperty(propertyName);
+ if (propertyValue != null)
+ {
+ return propertyValue;
+ }
+ }
+ return null;
+ }
+
+ public void pushObjectRenderContext(ObjectRendererContext ctx)
+ {
+ stack.add(ctx);
+ }
+
+ public ObjectRendererContext popObjectRenderContext()
+ {
+ return (ObjectRendererContext)stack.remove(stack.size() - 1);
+ }
+
+ public void render(ObjectRendererContext ctx) throws RenderException,
IllegalStateException
+ {
+ pushObjectRenderContext(ctx);
+
+ //
+ try
+ {
+ if (ctx instanceof PageRendererContext)
+ {
+ PageRendererContext prc = (PageRendererContext)ctx;
+ PageRenderer renderer = (PageRenderer)rendererFactory.getRenderer(this,
prc);
+ renderer.render(this, prc);
+ }
+ if (ctx instanceof WindowRendererContext)
+ {
+ WindowRendererContext wrc = (WindowRendererContext)ctx;
+ WindowRenderer renderer = (WindowRenderer)rendererFactory.getRenderer(this,
wrc);
+ renderer.render(this, wrc);
+ }
+ else if (ctx instanceof RegionRendererContext)
+ {
+ RegionRendererContext rrc = (RegionRendererContext)ctx;
+ RegionRenderer renderer = (RegionRenderer)rendererFactory.getRenderer(this,
rrc);
+
+ //
+ renderer.renderHeader(this, rrc);
+ renderer.renderBody(this, rrc);
+ renderer.renderFooter(this, rrc);
+ }
+ else if (ctx instanceof PortletRendererContext)
+ {
+ PortletRendererContext prc = (PortletRendererContext)ctx;
+ PortletRenderer renderer = (PortletRenderer)rendererFactory.getRenderer(this,
prc);
+ renderer.render(this, prc);
+ }
+ else if (ctx instanceof DecorationRendererContext)
+ {
+ DecorationRendererContext drc = (DecorationRendererContext)ctx;
+ DecorationRenderer renderer =
(DecorationRenderer)rendererFactory.getRenderer(this, drc);
+
+ //
+ renderer.render(this, drc);
+ }
+ }
+ finally
+ {
+ popObjectRenderContext();
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/theme/src/main/org/jboss/portal/theme/render/RendererFactory.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/RendererFactory.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/RendererFactory.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,13 +22,25 @@
******************************************************************************/
package org.jboss.portal.theme.render;
+import org.jboss.portal.theme.render.renderer.ObjectRenderer;
+import org.jboss.portal.theme.render.renderer.ObjectRendererContext;
+
/**
+ * A factory for providing the appropriate renderers.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
public interface RendererFactory
{
- ObjectRenderer getRenderer(RenderContext renderContext, ObjectRenderContext
objectRenderContext);
+ /**
+ * Return the appropriate renderer.
+ *
+ * @param rendererContext the render context
+ * @param objectRendererContext the object render context
+ * @return the appropriate renderer
+ */
+ ObjectRenderer getRenderer(RendererContext rendererContext, ObjectRendererContext
objectRendererContext);
}
Added: trunk/theme/src/main/org/jboss/portal/theme/render/ThemeContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/ThemeContext.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/ThemeContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render;
+
+import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.theme.ThemeServiceInfo;
+
+/**
+ * Provide a context for theme related services.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ThemeContext
+{
+
+ /** . */
+ private PortalTheme theme;
+
+ /** . */
+ private ThemeServiceInfo themeServiceInfo;
+
+ public ThemeContext(PortalTheme theme, ThemeServiceInfo themeServiceInfo)
+ {
+ this.theme = theme;
+ this.themeServiceInfo = themeServiceInfo;
+ }
+
+ /**
+ * Returns the render context theme, it may be null if no theme was set.
+ *
+ * @return the theme
+ */
+ public PortalTheme getTheme()
+ {
+ return theme;
+ }
+
+ /**
+ * Returns a theme matching the provided theme name or null if not found.
+ *
+ * @param themeName the theme name
+ * @return the theme
+ */
+ public PortalTheme getTheme(String themeName)
+ {
+ return themeServiceInfo.getTheme(themeName, false);
+ }
+}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderContext.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface WindowRenderContext extends ObjectRenderContext
-{
-
- String getId();
-
- int getOrder();
-
- WindowState getWindowState();
-
- Mode getMode();
-
- DecorationRenderContext getDecoration();
-
- PortletRenderContext getPortlet();
-
-}
Deleted: trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderer.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -1,60 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.theme.render;
-
-import org.jboss.portal.theme.page.WindowContext;
-import org.jboss.portal.theme.page.WindowResult;
-
-/**
- * A window renderer is responsible for the creation of the markup of each portlet window
in a portal page region. <p>A
- * Portlet window is the frame (the container) around the markup gernerated by the
Portlet. It includes things like the
- * title, and the portlet mode and portlet window state information. The window renderer
is assumed to delegate to the
- * <code>DecorationRenderer</code> to generate the title and mode and state
markup, and to the
- * <code>PortletRenderer</code> to render the markup produced by the portlet.
Note that the renderer do not call the
- * portlet container to execute the doView doEdit etc. method. The renderer is only
responsible for placing the created
- * markup inside the page, and creating the necessary markup around it.</p>
- *
- * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
- * @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortalRenderSet
- * @see RegionRenderer
- * @see DecorationRenderer
- * @see PortletRenderer
- */
-public interface WindowRenderer
- extends ObjectRenderer
-{
- /**
- * Render the markup of a portlet window.
- *
- * @param renderContext the state holder to provide information about the region,
it's portlets, and the render set,
- * which allows access to the other renderer interfaces of the
render set.
- * @throws RenderException
- * @see RegionRenderer#renderBody
- * @see PortletRenderer#render
- * @see DecorationRenderer#render
- * @see WindowContext
- * @see WindowResult
- */
- void render(RenderContext renderContext, WindowRenderContext wrc) throws
RenderException;
-}
Copied:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ActionRendererContext.java
(from rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/render/ActionRenderContext.java)
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ActionRendererContext.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ActionRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ActionRendererContext extends ObjectRendererContext
+{
+ /** . */
+ String MODES_KEY = "mode";
+ /** . */
+ String WINDOWSTATES_KEY = "windowstate";
+
+ String getName();
+
+ String getFamily();
+
+ String getURL();
+
+ boolean isEnabled();
+
+}
Copied:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRenderer.java (from
rev 6941, trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderer.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRenderer.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.RenderException;
+
+/**
+ * A decoration renderer is responsible for generating the markup of the portlet window
title bar. <p>The decoration
+ * renderer has the responsibility to create the title , the window state links, and the
portlet mode links. It is
+ * intended to be called by the <code>WindowRenderer</code> to produce part
of the markup of a portlet wiindow. The
+ * other parts are intended to be created by the
<code>PortletRenderer</code>, and the <code>WindowRenderer</code>
+ * itself.</p>
+ *
+ * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
+ * @version $LastChangedRevision$, $LastChangedDate$
+ * @see org.jboss.portal.theme.PortalRenderSet
+ * @see WindowRenderer
+ * @see PortletRenderer
+ */
+public interface DecorationRenderer extends ObjectRenderer
+{
+ /**
+ * Create the markup for the portlet decoration
+ *
+ * @param rendererContext the state holder to provide information about the region,
it's portlets, and the render set,
+ * which allows access to the other renderer interfaces of the
render set.
+ * @throws org.jboss.portal.theme.render.RenderException
+ */
+ void render(RendererContext rendererContext, DecorationRendererContext drc) throws
RenderException;
+
+}
Property changes on:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRenderer.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRendererContext.java
(from rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/render/DecorationRenderContext.java)
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRendererContext.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/DecorationRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface DecorationRendererContext extends ObjectRendererContext
+{
+
+ String getId();
+
+ String getTitle();
+
+ Collection getTriggerableActions(String familyName);
+}
Copied: trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRenderer.java
(from rev 6941, trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderer.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRenderer.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+/**
+ * Generic renderer interface extended by all members of a render set.
+ *
+ * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
+ * @version $LastChangedRevision$, $LastChangedDate$
+ * @see org.jboss.portal.theme.PortalRenderSet
+ */
+public interface ObjectRenderer
+{
+}
Property changes on:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRenderer.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRendererContext.java
(from rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/render/ObjectRenderContext.java)
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRendererContext.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/ObjectRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ObjectRendererContext
+{
+ String getProperty(String name);
+}
Copied: trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PageRenderer.java
(from rev 6941, trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderer.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PageRenderer.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PageRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.RenderException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PageRenderer extends ObjectRenderer
+{
+ void render(RendererContext rendererContext, PageRendererContext prc) throws
RenderException;
+}
Copied:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PageRendererContext.java (from
rev 6941, trunk/theme/src/main/org/jboss/portal/theme/render/PageRenderContext.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PageRendererContext.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PageRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PageRendererContext extends ObjectRendererContext
+{
+ Collection getRegions();
+
+ RegionRendererContext getRegion(String regionName);
+
+ WindowRendererContext getWindow(String windowId);
+}
Copied: trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRenderer.java
(from rev 6941, trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderer.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRenderer.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.RenderException;
+
+/**
+ * The portlet renderer is responsible for adding the created markup of a portlet to the
page. <p>The portlet renderer
+ * is intended to be called by the <code>WindowRenderer</code> as part of the
generation of the markup for a portlet
+ * window. The portlet renderer is not responsible for generating the decoration markup,
like the title. The
+ * <code>DecorationRenderer</code> is responsible for that. It is also called
by the <code>WindowRenderer</code> as part
+ * of the render process for one portlet window.</p>
+ *
+ * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
+ * @version $LastChangedRevision$, $LastChangedDate$
+ * @see org.jboss.portal.theme.PortalRenderSet
+ * @see WindowRenderer
+ * @see DecorationRenderer
+ */
+public interface PortletRenderer
+ extends ObjectRenderer
+{
+ /**
+ * Render the markup of a portlet. <p>Note: this is not calling the portlet
container to produce the markup. The
+ * markup has already been created. The PortletRenderer only places the markup on the
page, and can gnerate some
+ * containing markup around it if it chooses to do so</p>.
+ *
+ * @param rendererContext the state holder to provide information about the region,
it's portlets, and the render set,
+ * which allows access to the other renderer interfaces of the
render set.
+ * @throws org.jboss.portal.theme.render.RenderException
+ */
+ void render(RendererContext rendererContext, PortletRendererContext prc) throws
RenderException;
+}
Property changes on:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRenderer.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRendererContext.java
(from rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/render/PortletRenderContext.java)
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRendererContext.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/PortletRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PortletRendererContext extends ObjectRendererContext
+{
+
+ String getMarkup();
+
+}
Copied: trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRenderer.java
(from rev 6941, trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderer.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRenderer.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.RenderException;
+
+/**
+ * A region renderer is responsible to create the markup container for a set of portlets
on a page region. <p>The
+ * Portlets on a portal page can be assigned to regions of that page. Regions are sub
elements of a page, that will be
+ * used by a layout to position groups of portlets over the areas of the page. The region
renderer can be invoked to
+ * render the entire content of the region. It is assumed to take over the responsibility
of delegating to the
+ * <code>WindowRenderer</code> for each portlet that needs to be rendered in
the region in question.</p>
+ *
+ * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
+ * @version $LastChangedRevision$, $LastChangedDate$
+ * @see org.jboss.portal.theme.PortalRenderSet
+ * @see WindowRenderer
+ */
+public interface RegionRenderer
+ extends ObjectRenderer
+{
+ void renderBody(RendererContext rendererContext, RegionRendererContext rrc) throws
RenderException;
+
+ void renderHeader(RendererContext rendererContext, RegionRendererContext rrc) throws
RenderException;
+
+ void renderFooter(RendererContext rendererContext, RegionRendererContext rrc) throws
RenderException;
+}
Property changes on:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRenderer.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRendererContext.java
(from rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/render/RegionRenderContext.java)
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRendererContext.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/RegionRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import org.jboss.portal.theme.Orientation;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface RegionRendererContext extends ObjectRendererContext
+{
+
+ String getId();
+
+ Collection getWindows();
+
+ Orientation getOrientation();
+
+ String getCSSId();
+}
Copied: trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRenderer.java
(from rev 6941, trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderer.java)
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRenderer.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRenderer.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import org.jboss.portal.theme.page.WindowContext;
+import org.jboss.portal.theme.page.WindowResult;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.RenderException;
+
+/**
+ * A window renderer is responsible for the creation of the markup of each portlet window
in a portal page region. <p>A
+ * Portlet window is the frame (the container) around the markup gernerated by the
Portlet. It includes things like the
+ * title, and the portlet mode and portlet window state information. The window renderer
is assumed to delegate to the
+ * <code>DecorationRenderer</code> to generate the title and mode and state
markup, and to the
+ * <code>PortletRenderer</code> to render the markup produced by the portlet.
Note that the renderer do not call the
+ * portlet container to execute the doView doEdit etc. method. The renderer is only
responsible for placing the created
+ * markup inside the page, and creating the necessary markup around it.</p>
+ *
+ * @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
+ * @version $LastChangedRevision$, $LastChangedDate$
+ * @see org.jboss.portal.theme.PortalRenderSet
+ * @see RegionRenderer
+ * @see DecorationRenderer
+ * @see PortletRenderer
+ */
+public interface WindowRenderer
+ extends ObjectRenderer
+{
+ /**
+ * Render the markup of a portlet window.
+ *
+ * @param rendererContext the state holder to provide information about the region,
it's portlets, and the render set,
+ * which allows access to the other renderer interfaces of the
render set.
+ * @throws org.jboss.portal.theme.render.RenderException
+ * @see RegionRenderer#renderBody
+ * @see PortletRenderer#render
+ * @see DecorationRenderer#render
+ * @see WindowContext
+ * @see WindowResult
+ */
+ void render(RendererContext rendererContext, WindowRendererContext wrc) throws
RenderException;
+}
Property changes on:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRenderer.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRendererContext.java
(from rev 6941,
trunk/theme/src/main/org/jboss/portal/theme/render/WindowRenderContext.java)
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRendererContext.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRendererContext.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.theme.render.renderer;
+
+import org.jboss.portal.WindowState;
+import org.jboss.portal.Mode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface WindowRendererContext extends ObjectRendererContext
+{
+
+ String getId();
+
+ int getOrder();
+
+ WindowState getWindowState();
+
+ Mode getMode();
+
+ DecorationRendererContext getDecoration();
+
+ PortletRendererContext getPortlet();
+
+}
Modified: trunk/theme/src/main/org/jboss/portal/theme/tag/PortletTagHandler.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/tag/PortletTagHandler.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/tag/PortletTagHandler.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -24,7 +24,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.theme.LayoutConstants;
-import org.jboss.portal.theme.render.PageRenderContext;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
import org.jboss.portal.common.NotYetImplemented;
import javax.servlet.http.HttpServletRequest;
@@ -43,7 +43,7 @@
*
* @author <a href="mailto:mholzner@novell.com">Martin
Holzner</a>.
* @version <tt>$Revision$</tt>
- * @see org.jboss.portal.theme.render.PortalRenderSet
+ * @see org.jboss.portal.theme.PortalRenderSet
*/
public class PortletTagHandler extends SimpleTagSupport
{
@@ -58,10 +58,10 @@
*
* @throws javax.servlet.jsp.JspException
* @throws java.io.IOException
- * @see org.jboss.portal.theme.render.PortalRenderSet#getWindowRenderer
- * @see org.jboss.portal.theme.render.WindowRenderer#render
- * @see org.jboss.portal.theme.render.PortletRenderer#render
- * @see org.jboss.portal.theme.render.DecorationRenderer#render
+ * @see org.jboss.portal.theme.PortalRenderSet#getWindowRenderer
+ * @see org.jboss.portal.theme.render.renderer.WindowRenderer#render
+ * @see org.jboss.portal.theme.render.renderer.PortletRenderer#render
+ * @see org.jboss.portal.theme.render.renderer.DecorationRenderer#render
*/
public void doTag() throws JspException, IOException
{
@@ -82,7 +82,7 @@
PageContext app = (PageContext)getJspContext();
HttpServletRequest request = (HttpServletRequest)app.getRequest();
- PageRenderContext page =
(PageRenderContext)request.getAttribute(LayoutConstants.ATTR_PAGE);
+ PageRendererContext page =
(PageRendererContext)request.getAttribute(LayoutConstants.ATTR_PAGE);
if (page == null)
{
out.write("<p bgcolor='red'>No page to
render!</p>");
Modified: trunk/theme/src/main/org/jboss/portal/theme/tag/RegionTagHandler.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/tag/RegionTagHandler.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/tag/RegionTagHandler.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -25,10 +25,10 @@
import org.jboss.logging.Logger;
import org.jboss.portal.theme.LayoutConstants;
import org.jboss.portal.theme.Orientation;
-import org.jboss.portal.theme.impl.JSPRenderContext;
+import org.jboss.portal.theme.impl.JSPRendererContext;
import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.RegionRenderContext;
-import org.jboss.portal.theme.render.PageRenderContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
@@ -48,7 +48,7 @@
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @author <a href="mailto:roy@jboss.org>Roy Russo</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.theme.render.PortalRenderSet
+ * @see org.jboss.portal.theme.PortalRenderSet
*/
public class RegionTagHandler
extends SimpleTagSupport
@@ -78,7 +78,7 @@
PageContext app = (PageContext)getJspContext();
HttpServletRequest request = (HttpServletRequest)app.getRequest();
- PageRenderContext page =
(PageRenderContext)request.getAttribute(LayoutConstants.ATTR_PAGE);
+ PageRendererContext page =
(PageRendererContext)request.getAttribute(LayoutConstants.ATTR_PAGE);
JspWriter out = this.getJspContext().getOut();
if (page == null)
{
@@ -95,7 +95,7 @@
if (page.getRegion(regionName) == null) // non-window display of content
{
// Create a dummy region obj, based on region name
- RegionRenderContext rrc = new RegionRenderContext()
+ RegionRendererContext rrc = new RegionRendererContext()
{
public String getId()
{
@@ -105,7 +105,7 @@
{
return Collections.EMPTY_LIST;
}
- public PageRenderContext getPage()
+ public PageRendererContext getPage()
{
return null;
}
@@ -123,7 +123,7 @@
}
};
- JSPRenderContext renderContext =
(JSPRenderContext)request.getAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
+ JSPRendererContext renderContext =
(JSPRendererContext)request.getAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
try
{
PrintWriter pw = new PrintWriter(out);
@@ -139,15 +139,15 @@
else
{
// window-centric display of content
- JSPRenderContext renderContext =
(JSPRenderContext)request.getAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
+ JSPRendererContext renderContext =
(JSPRendererContext)request.getAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
if (renderContext == null)
{
log.debug("no render context available in request");
return;
}
- final RegionRenderContext region = page.getRegion(regionName);
- RegionRenderContext rrc = new RegionRenderContext()
+ final RegionRendererContext region = page.getRegion(regionName);
+ RegionRendererContext rrc = new RegionRendererContext()
{
public String getId()
{
Modified: trunk/theme/src/main/org/jboss/portal/theme/tag/ThemeTagHandler.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/tag/ThemeTagHandler.java 2007-04-07
00:31:37 UTC (rev 6941)
+++ trunk/theme/src/main/org/jboss/portal/theme/tag/ThemeTagHandler.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -24,12 +24,11 @@
import org.jboss.logging.Logger;
import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.ThemeServiceInfo;
import org.jboss.portal.theme.LayoutConstants;
import org.jboss.portal.theme.ThemeElement;
import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
-import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.theme.render.RendererContext;
+import org.jboss.portal.theme.render.ThemeContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
@@ -70,8 +69,6 @@
*
* @throws JspException
* @throws IOException
- * @see org.jboss.portal.theme.ThemeConstants#ATTR_THEME
- * @see org.jboss.portal.theme.ThemeConstants#ATTR_THEME_SERVER
* @see org.jboss.portal.theme.PortalTheme
*/
public void doTag() throws JspException, IOException
@@ -83,18 +80,19 @@
HttpServletRequest request = (HttpServletRequest)app.getRequest();
// Get the theme provided as a render context attribute
- RenderContext renderContext =
(RenderContext)request.getAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
- PortalTheme theme =
(PortalTheme)renderContext.getAttribute(ThemeConstants.ATTR_THEME);
- ThemeServiceInfo themeServer =
(ThemeServiceInfo)renderContext.getAttribute(ThemeConstants.ATTR_THEME_SERVER);
+ RendererContext rendererContext =
(RendererContext)request.getAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
+ ThemeContext themeContext = rendererContext.getThemeContext();
+ PortalTheme theme = themeContext.getTheme();
+
//
- String jsBase = renderContext.getProperty(DynaConstants.DYNA_RESOURCE_BASE_URL);
+ String jsBase = rendererContext.getProperty(DynaConstants.DYNA_RESOURCE_BASE_URL);
out.print("<link rel=\"stylesheet\" id=\"dyna_css\"
href=\"" + jsBase + "/style.css\"
type=\"text/css\"/>\n");
// If no theme provided we use what may be on the tag
- if (theme == null && themeServer != null && themeName != null
&& themeName.length() > 0)
+ if (theme == null && themeName != null && themeName.length() >
0)
{
- theme = themeServer.getTheme(getThemeName(), false);
+ theme = themeContext.getTheme(getThemeName());
}
//
Modified:
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/ForEachActionInWindowTag.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/ForEachActionInWindowTag.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/ForEachActionInWindowTag.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.tag.basic;
-import org.jboss.portal.theme.render.ActionRenderContext;
+import org.jboss.portal.theme.render.renderer.ActionRendererContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
@@ -63,7 +63,7 @@
{
if (iterator.hasNext())
{
- ActionRenderContext action = (ActionRenderContext)iterator.next();
+ ActionRendererContext action = (ActionRendererContext)iterator.next();
pageContext.setAttribute(ForEachActionInWindowTEI.IMPLICIT_NAME,
action.getName());
pageContext.setAttribute(ForEachActionInWindowTEI.IMPLICIT_URL,
action.getURL());
pageContext.setAttribute(ForEachActionInWindowTEI.IMPLICIT_ENABLED,
Boolean.valueOf(action.isEnabled()));
Modified:
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/ForEachWindowInRegionTag.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/ForEachWindowInRegionTag.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/ForEachWindowInRegionTag.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -23,9 +23,9 @@
package org.jboss.portal.theme.tag.basic;
import org.jboss.portal.theme.LayoutConstants;
-import org.jboss.portal.theme.render.PageRenderContext;
-import org.jboss.portal.theme.render.RegionRenderContext;
-import org.jboss.portal.theme.render.WindowRenderContext;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
+import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
@@ -53,10 +53,10 @@
private Iterator iterator;
/** . */
- private PageRenderContext pageRenderContext;
+ private PageRendererContext pageRenderContext;
/** . */
- private WindowRenderContext windowRenderContext;
+ private WindowRendererContext windowRenderContext;
public String getRegion()
{
@@ -68,7 +68,7 @@
this.region = region;
}
- public WindowRenderContext getWindowRenderContext()
+ public WindowRendererContext getWindowRenderContext()
{
return windowRenderContext;
}
@@ -80,7 +80,7 @@
if (iterator.hasNext())
{
// Get the next window context
- windowRenderContext = (WindowRenderContext)iterator.next();
+ windowRenderContext = (WindowRendererContext)iterator.next();
// Set the implicit content
pageContext.setAttribute(ForEachWindowInRegionTEI.IMPLICIT_CONTENT,
this.windowRenderContext.getPortlet().getMarkup());
@@ -100,19 +100,19 @@
public int doStartTag() throws JspException
{
// Get the aggrehated page result from the request
- pageRenderContext =
(PageRenderContext)pageContext.getRequest().getAttribute(LayoutConstants.ATTR_PAGE);
+ pageRenderContext =
(PageRendererContext)pageContext.getRequest().getAttribute(LayoutConstants.ATTR_PAGE);
// Aggregate the regions parameterized in the region attribute
List windows = new ArrayList(10);
for (StringTokenizer tokenizer = new StringTokenizer(this.region, ",");
tokenizer.hasMoreTokens();)
{
String token = tokenizer.nextToken().trim();
- RegionRenderContext region = pageRenderContext.getRegion(token);
+ RegionRendererContext region = pageRenderContext.getRegion(token);
if (region != null)
{
for (Iterator i = region.getWindows().iterator(); i.hasNext();)
{
- WindowRenderContext window = (WindowRenderContext)i.next();
+ WindowRendererContext window = (WindowRendererContext)i.next();
windows.add(window);
}
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/tag/basic/IfRegionExistsTag.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/IfRegionExistsTag.java 2007-04-07
00:31:37 UTC (rev 6941)
+++
trunk/theme/src/main/org/jboss/portal/theme/tag/basic/IfRegionExistsTag.java 2007-04-07
10:13:16 UTC (rev 6942)
@@ -23,8 +23,8 @@
package org.jboss.portal.theme.tag.basic;
import org.jboss.portal.theme.LayoutConstants;
-import org.jboss.portal.theme.render.PageRenderContext;
-import org.jboss.portal.theme.render.RegionRenderContext;
+import org.jboss.portal.theme.render.renderer.PageRendererContext;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
@@ -55,8 +55,8 @@
public int doStartTag() throws JspException
{
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
- PageRenderContext page =
(PageRenderContext)request.getAttribute(LayoutConstants.ATTR_PAGE);
- RegionRenderContext region = page.getRegion(this.region);
+ PageRendererContext page =
(PageRendererContext)request.getAttribute(LayoutConstants.ATTR_PAGE);
+ RegionRendererContext region = page.getRegion(this.region);
if (region != null)
{
return Tag.EVAL_BODY_INCLUDE;