Author: julien(a)jboss.com
Date: 2007-04-05 18:19:51 -0400 (Thu, 05 Apr 2007)
New Revision: 6933
Modified:
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/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/impl/JSPLayout.java
trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
Log:
don't set on PageResult both layoutState and layoutURI. LayoutURI can be deduced from
the layoutState (which is the real intention) + the layout object just before doing the
request dispatching to the layout servlet. Furthermore layoutURI is an internal
implementation detail of the fact that the layouting of the different regions is done
primarily by a JSP
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-05
22:06:33 UTC (rev 6932)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java 2007-04-05
22:19:51 UTC (rev 6933)
@@ -108,15 +108,11 @@
windowProps.put(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER,
"emptyRenderer");
//
- WindowResult res = new WindowResult("", content,
Collections.EMPTY_MAP, windowProps, null, null, WindowState.NORMAL, Mode.VIEW);
+ WindowResult res = new WindowResult("", content,
Collections.EMPTY_MAP, windowProps, null, null, WindowState.MAXIMIZED, Mode.VIEW);
WindowContext blah = new WindowContext("BILTO", "BILTO",
"maximized", 0, res);
result.addWindowContext(blah);
//
- result.setLayoutState("maximized");
- result.setLayoutURI(layout.getLayoutInfo().getURI("maximized"));
-
- //
return new PageRendition(layout, 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-05
22:06:33 UTC (rev 6932)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java 2007-04-05
22:19:51 UTC (rev 6933)
@@ -203,9 +203,6 @@
new HashMap(getPage().getDeclaredProperties()),
new HashMap(getPage().getPortal().getDeclaredProperties()));
- // Set the layout uri
- pageResult.setLayoutURI(layout.getLayoutInfo().getURI());
-
// Set the theme on the result
if (theme != null)
{
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-05 22:06:33
UTC (rev 6932)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java 2007-04-05 22:19:51
UTC (rev 6933)
@@ -96,7 +96,6 @@
pageRenderCtx.getPortalProperties().put(ThemeConstants.PORTAL_PROP_RENDERSET,
renderSet.getName());
pageRenderCtx.getPortalProperties().put(ThemeConstants.PORTAL_PROP_LAYOUT,
layout.getLayoutInfo().getName());
pageRenderCtx.setLayoutState(null);
- pageRenderCtx.setLayoutURI(layout.getLayoutInfo().getURI("maximized"));
//
for (int i = 0; i < 2; i++)
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-05
22:06:33 UTC (rev 6932)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java 2007-04-05
22:19:51 UTC (rev 6933)
@@ -141,7 +141,6 @@
// pageresult obj
PageResult pageResult = new PageResult(TEST_PAGE_NAME, pageProps, portalProps);
- pageResult.setLayoutURI(layout.getLayoutInfo().getURI());
pageResult.setTheme(theme);
// create window ctx/results and add to page result
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-05
22:06:33 UTC (rev 6932)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/servlet/TestThemeServlet.java 2007-04-05
22:19:51 UTC (rev 6933)
@@ -108,7 +108,6 @@
// pageresult obj
PageResult pageResult = new PageResult(TEST_PAGE_NAME, pageProps, portalProps);
- pageResult.setLayoutURI(layout.getLayoutInfo().getURI());
pageResult.setTheme(theme);
// create window ctx/results and add to page result
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-05 22:06:33
UTC (rev 6932)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-04-05 22:19:51
UTC (rev 6933)
@@ -104,7 +104,6 @@
// pageResult = newRes;
pageResult.setLayoutState("maximized");
- pageResult.setLayoutURI(getLayoutInfo().getURI("maximized"));
wc.setRegionName("maximized");
wc.setOrder(0);
break;
@@ -116,8 +115,9 @@
try
{
-
- LayoutDispatcher dispatcher = new LayoutDispatcher(renderContext, prc,
pageResult.getLayoutURI(), getLayoutInfo());
+ String layoutState = pageResult.getLayoutState();
+ String layoutURI = getLayoutInfo().getURI(layoutState);
+ LayoutDispatcher dispatcher = new LayoutDispatcher(renderContext, prc,
layoutURI, getLayoutInfo());
dispatcher.include();
}
catch (IOException e)
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-05 22:06:33
UTC (rev 6932)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java 2007-04-05 22:19:51
UTC (rev 6933)
@@ -60,9 +60,6 @@
protected Map pageProperties;
/** . */
- protected String layoutURI;
-
- /** . */
protected String layoutState;
/** . */
@@ -142,17 +139,6 @@
}
/**
- * Get the uri of the layout that is used. <p>The uri is relative to the
application context that hosts the
- * layout.</p>
- *
- * @return the uri of the used layout
- */
- public String getLayoutURI()
- {
- return layoutURI;
- }
-
- /**
* Get the state string of the layout. <p>The state is used to further sub
select a layout uri. One layout can
* contain a separate layout uri per state. The state has to match to string version
of one of the allowed window
* states.<p>
@@ -164,6 +150,11 @@
return layoutState;
}
+ public void setLayoutState(String layoutState)
+ {
+ this.layoutState = layoutState;
+ }
+
/**
* Get a Set of all window ids that are contained in this page.
*
@@ -200,16 +191,6 @@
return windowContexts;
}
- public void setLayoutURI(String uri)
- {
- layoutURI = uri;
- }
-
- public void setLayoutState(String layoutState)
- {
- this.layoutState = layoutState;
- }
-
public void addWindowContext(WindowContext windowContext)
{
windowContexts.put(windowContext.getId(), windowContext);