[portal-commits] JBoss Portal SVN: r8984 - branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Sat Nov 17 07:29:15 EST 2007


Author: julien at jboss.com
Date: 2007-11-17 07:29:15 -0500 (Sat, 17 Nov 2007)
New Revision: 8984

Modified:
   branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
Log:
basic impl of window render in PS

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 11:28:58 UTC (rev 8983)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java	2007-11-17 12:29:15 UTC (rev 8984)
@@ -27,6 +27,13 @@
 import org.jboss.portal.presentation.server.PresentationServer;
 import org.jboss.portal.presentation.model.UIWindow;
 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.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.content.WindowRendition;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -34,6 +41,11 @@
  */
 public class PresentationServerImpl implements PresentationServer
 {
+
+
+   /** . */
+   private Controller controller;
+
    /**
     * 
     */
@@ -109,7 +121,29 @@
     * 
     */
    public String getMarkup(RequestContext context, UIWindow window) throws Exception
-   {      
+   {
+      PortalObjectId windowId = null;
+      RenderWindowCommand rwc = new RenderWindowCommand(windowId);
+      ControllerContext ctx = new ControllerContext(context.getInvocation(), controller);
+      WindowRendition rendition = rwc.render(ctx);
+      if (rendition != null)
+      {
+         ControllerResponse response = rendition.getControllerResponse();
+
+         // Null means we skip the window
+         if (response != null)
+         {
+            if (response instanceof MarkupResponse)
+            {
+               return ((MarkupResponse)response).getContent();
+            }
+            else if (response != null)
+            {
+               // It may be an error, handle it
+            }
+         }
+      }
+
       return null;
    }
 }




More information about the portal-commits mailing list