Author: sohil.shah(a)jboss.com
Date: 2007-11-17 16:51:55 -0500 (Sat, 17 Nov 2007)
New Revision: 8994
Added:
branches/UIServer/core/src/main/org/jboss/portal/core/controller/ControllerContextFactory.java
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/controller/Controller.java
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
branches/UIServer/server/src/main/org/jboss/portal/server/RequestController.java
Log:
render hack
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/controller/Controller.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/controller/Controller.java 2007-11-17
21:17:04 UTC (rev 8993)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/controller/Controller.java 2007-11-17
21:51:55 UTC (rev 8994)
@@ -56,7 +56,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class Controller extends AbstractJBossService implements RequestController
+public class Controller extends AbstractJBossService implements RequestController,
ControllerContextFactory
{
/** . */
@@ -209,6 +209,11 @@
{
this.pageControlPolicy = pageControlPolicy;
}
+
+ public ControllerContext getControllerContext(ServerInvocation invocation) throws
ServerException
+ {
+ return new ControllerContext(invocation, this);
+ }
public final void handle(ServerInvocation invocation) throws ServerException
{
Added:
branches/UIServer/core/src/main/org/jboss/portal/core/controller/ControllerContextFactory.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/controller/ControllerContextFactory.java
(rev 0)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/controller/ControllerContextFactory.java 2007-11-17
21:51:55 UTC (rev 8994)
@@ -0,0 +1,9 @@
+package org.jboss.portal.core.controller;
+
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.ServerException;
+
+public interface ControllerContextFactory
+{
+ public ControllerContext getControllerContext(ServerInvocation invocation) throws
ServerException;
+}
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-17
21:17:04 UTC (rev 8993)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-17
21:51:55 UTC (rev 8994)
@@ -30,10 +30,12 @@
import org.jboss.portal.presentation.model.state.ModelLoader;
import org.jboss.portal.core.controller.Controller;
import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.controller.ControllerContextFactory;
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
import org.jboss.portal.core.model.portal.command.response.MarkupResponse;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
import org.jboss.portal.core.model.portal.content.WindowRendition;
/**
@@ -45,7 +47,7 @@
/** . */
- private Controller controller;
+ private ControllerContextFactory controllerContextFactory;
/**
*
@@ -117,12 +119,31 @@
{
this.processor = processor;
}
+
+ /**
+ *
+ * @return
+ */
+ public ControllerContextFactory getControllerContextFactory()
+ {
+ return controllerContextFactory;
+ }
+ /**
+ *
+ * @param controllerContextFactory
+ */
+ public void setControllerContextFactory(
+ ControllerContextFactory controllerContextFactory)
+ {
+ this.controllerContextFactory = controllerContextFactory;
+ }
+
public WindowContent render(RequestContext context, UIWindow window) throws Exception
{
- /*PortalObjectId windowId = null;
+ PortalObjectId windowId = PortalObjectId.parse(window.getId(),
PortalObjectPath.CANONICAL_FORMAT);
RenderWindowCommand rwc = new RenderWindowCommand(windowId);
- ControllerContext ctx = new ControllerContext(context.getInvocation(),
controller);
+ ControllerContext ctx =
this.controllerContextFactory.getControllerContext(context.getInvocation());
WindowRendition rendition = rwc.render(ctx);
if (rendition != null)
{
@@ -143,8 +164,8 @@
}
}
- return null;*/
+ return null;
- return new WindowContent(-1, "MockTitle", "<div>Mock
Content</div>");
+ //return new WindowContent(-1, "MockTitle", "<div>Mock
Content</div>");
}
}
Modified: branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
---
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-17
21:17:04 UTC (rev 8993)
+++
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-17
21:51:55 UTC (rev 8994)
@@ -1099,6 +1099,7 @@
<xmbean/>
<depends optional-attribute-name="Processor"
proxy-type="attribute">portal:service=Processor</depends>
<depends optional-attribute-name="ModelLoader"
proxy-type="attribute">portal:container=ModelLoader</depends>
+ <depends optional-attribute-name="ControllerContextFactory"
proxy-type="attribute">portal:service=RequestController</depends>
<depends>portal:service=PageService</depends>
<depends>portal:commandFactory=DefaultPortal</depends>
<depends>portal:urlFactory=Delegating</depends>
Modified:
branches/UIServer/server/src/main/org/jboss/portal/server/RequestController.java
===================================================================
---
branches/UIServer/server/src/main/org/jboss/portal/server/RequestController.java 2007-11-17
21:17:04 UTC (rev 8993)
+++
branches/UIServer/server/src/main/org/jboss/portal/server/RequestController.java 2007-11-17
21:51:55 UTC (rev 8994)
@@ -36,5 +36,5 @@
*
* @param invocation the server invocation
*/
- void handle(ServerInvocation invocation) throws ServerException;
+ void handle(ServerInvocation invocation) throws ServerException;
}