[portal-commits] JBoss Portal SVN: r8829 - in branches/UIServer/uiserver: gwt-dev-env and 8 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Tue Nov 6 02:18:27 EST 2007


Author: sohil.shah at jboss.com
Date: 2007-11-06 02:18:27 -0500 (Tue, 06 Nov 2007)
New Revision: 8829

Added:
   branches/UIServer/uiserver/gwt-dev-env/Portal(uiserver).launch
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/PortalRPC.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/PortalRPCAsync.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/EntryPoint.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/EntryPointImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/HostedModeProxy.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortalRPCImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortletServiceImpl.java
Removed:
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortletServiceImpl.java
Modified:
   branches/UIServer/uiserver/build.xml
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/AsyncPages.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Page.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PartialRefresh.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Portal.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PortletService.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PortletServiceAsync.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Window.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/GWTClientFilter.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
   branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/AsyncPages.gwt.xml
   branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/PartialRefresh.gwt.xml
   branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml
   branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/PortalLayout.gwt.xml
   branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/index.html
   branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml
   branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/web.xml
Log:
GWT-based Ajax client/Presentation Framework integration

Modified: branches/UIServer/uiserver/build.xml
===================================================================
--- branches/UIServer/uiserver/build.xml	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/build.xml	2007-11-06 07:18:27 UTC (rev 8829)
@@ -92,6 +92,7 @@
          <path refid="apache.log4j.classpath"/>
       	 <path refid="junit.junit.classpath"/>
       	 <path refid="gwt.gwt.classpath"/>
+      	 <path refid="httpunit.httpunit.classpath"/>
       </path>
 
       <!-- Configure modules -->

Added: branches/UIServer/uiserver/gwt-dev-env/Portal(uiserver).launch
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/Portal(uiserver).launch	                        (rev 0)
+++ branches/UIServer/uiserver/gwt-dev-env/Portal(uiserver).launch	2007-11-06 07:18:27 UTC (rev 8829)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.GWTShell"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;UIServer&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/UIServer/uiserver/src/main&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/UIServer/uiserver/src/resources/client/ajax/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/UIServer/uiserver/gwt-dev-env/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;UIServer&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/UIServer/uiserver/gwt-dev-env/gwt-dev-linux.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-out www org.jboss.portal.uiserver.ajax.Portal/index.html"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="UIServer"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/UIServer"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="GWT_EXTERNAL_BROWSER" value="/home/soshah/firefox/firefox"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:UIServer/uiserver/gwt-dev-env}"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+</launchConfiguration>

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/AsyncPages.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/AsyncPages.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/AsyncPages.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -350,20 +350,20 @@
       };
       
       //Dispalying the fully aggregated page
-      Window[] windows = portalPage.windows;
+      Window[] windows = portalPage.getWindows();
       HorizontalPanel page = (HorizontalPanel)RootPanel.get("currentPage").getWidget(0);
       page.clear();
       for(int i=0; i<windows.length; i++)
       {
          Window pageWindow = windows[i]; 
-         if(pageWindow.isVisible)
+         if(pageWindow.isVisible())
          {
             VerticalPanel window = new VerticalPanel();
             window.setBorderWidth(2);
             
             //Create the decoration panel
             HorizontalPanel decoration = new HorizontalPanel();
-            decoration.setTitle(pageWindow.name);
+            decoration.setTitle(pageWindow.getName());
                         
             Button normal = new Button("Normal");            
             Button minimized = new Button("Minimized");            
@@ -377,7 +377,7 @@
             window.add(decoration);
             
             //Create the actual content of the portlet to be displayed inside the window
-            HTML windowContent = new HTML(pageWindow.content);
+            HTML windowContent = new HTML(pageWindow.getContent());
             window.add(windowContent);
                                                             
             //Event listeners for this Window

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Page.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Page.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Page.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -1,9 +1,45 @@
 package org.jboss.portal.uiserver.ajax.client;
 
-import java.io.Serializable;
+import com.google.gwt.user.client.rpc.IsSerializable;
 
-public class Page implements Serializable
+public class Page implements IsSerializable
 {
-   public String name = null;
-   public Window[] windows = null;
+   private String name = null;
+   private Window[] windows = null;
+   
+   /**
+    * 
+    * @return
+    */
+   public String getName()
+   {
+      return name;
+   }
+   
+   /**
+    * 
+    * @param name
+    */
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   /**
+    * 
+    * @return
+    */
+   public Window[] getWindows()
+   {
+      return windows;
+   }
+   
+   /**
+    * 
+    * @param windows
+    */
+   public void setWindows(Window[] windows)
+   {
+      this.windows = windows;
+   }   
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PartialRefresh.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PartialRefresh.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PartialRefresh.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -338,19 +338,19 @@
       };
       
       //Dispalying the fully aggregated page
-      Window[] windows = portalPage.windows;
+      Window[] windows = portalPage.getWindows();
       VerticalPanel page = (VerticalPanel)RootPanel.get("page").getWidget(0);
       page.clear();
       for(int i=0; i<windows.length; i++)
       {
          Window pageWindow = windows[i]; 
-         if(pageWindow.isVisible)
+         if(pageWindow.isVisible())
          {
             VerticalPanel window = new VerticalPanel();
             
             //Create the decoration panel
             HorizontalPanel decoration = new HorizontalPanel();
-            decoration.setTitle(pageWindow.name);
+            decoration.setTitle(pageWindow.getName());
                         
             Button normal = new Button("Normal");            
             Button minimized = new Button("Minimized");            
@@ -364,7 +364,7 @@
             window.add(decoration);
             
             //Create the actual content of the portlet to be displayed inside the window
-            HTML windowContent = new HTML(pageWindow.content);
+            HTML windowContent = new HTML(pageWindow.getContent());
             window.add(windowContent);
                                                             
             //Event listeners for this Window

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Portal.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Portal.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Portal.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -17,13 +17,13 @@
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.TabBar;
-import com.google.gwt.user.client.ui.TabListener;
-import com.google.gwt.user.client.ui.SourcesTabEvents;
 
 import com.google.gwt.user.client.rpc.ServiceDefTarget;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 
+import org.jboss.portal.uiserver.ajax.client.service.PortalRPC;
+import org.jboss.portal.uiserver.ajax.client.service.PortalRPCAsync;
+
 /**
  * Entry point classes define <code>onModuleLoad()</code>.
  */
@@ -34,6 +34,8 @@
     */
    public void onModuleLoad()
    { 
+      HorizontalPanel page = new HorizontalPanel();
+      RootPanel.get("currentPage").add(page);
       this.loadPortal();
    }
    
@@ -42,30 +44,9 @@
     *
     */
    private void loadPortal()
-   {
-      //Load the navigation bar....use a tabbed bar
-      TabBar pageNavigator = new TabBar();
-      pageNavigator.addTab("Page 1");
-      pageNavigator.addTab("Page 2");
-      pageNavigator.addTab("Page 3");
-      pageNavigator.selectTab(0);
-      pageNavigator.addTabListener(new TabListenerImpl());
-      RootPanel.get("pageNavigator").add(pageNavigator);      
-      
-      //Load the main page to be displayed
-      HorizontalPanel page = new HorizontalPanel();
-      RootPanel.get("currentPage").add(page);      
-      this.loadPartialRefreshPage("Page 1");      
-   }
-   
-   /**
-    * 
-    *
-    */
-   private void loadPartialRefreshPage(String pageId)
-   {      
-      PortletServiceAsync portletService = (PortletServiceAsync)GWT.create(PortletService.class);      
-      ((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portletService");
+   {    
+      PortalRPCAsync portalRPC = (PortalRPCAsync)GWT.create(PortalRPC.class);      
+      ((ServiceDefTarget)portalRPC).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
             
       AsyncCallback callback = new AsyncCallback()
       {
@@ -80,18 +61,139 @@
          }
       };
       
-      portletService.getPage(pageId, callback);      
-   }
+      portalRPC.loadPortal(callback);
+   }  
    
    /**
     * 
+    * @param portalPage
+    */
+   private void displayPortalPage(Page portalPage)
+   {
+      //Event Listener for the decoration components like
+      //Normal, Maximized, Minimized
+      /*ClickListener listener = new ClickListener()
+      {
+         public void onClick(Widget sender)
+         {   
+            Button cour = (Button)sender;
+            String windowName = sender.getParent().getTitle();
+            if(cour.getText().equals("Normal"))
+            {
+               handleWindowStateChanged(windowName, Window.NORMAL);
+            }
+            else if(cour.getText().equals("Minimized"))
+            {
+               handleWindowStateChanged(windowName, Window.MINIMIZED);
+            }
+            else if(cour.getText().equals("Maximized"))
+            {
+               handleWindowStateChanged(windowName, Window.MAXIMIZED);
+            }
+            else if(cour.getText().equals("Edit"))
+            {
+               handleWindowModeChanged(windowName, Window.EDIT);
+            }
+         } 
+      };
+      
+      //Event Listener for actions perfomed inside the portlet window content
+      //itself.
+      ClickListener contentListener = new ClickListener()
+      {
+         public void onClick(Widget sender)
+         {
+            Event event = DOM.eventGetCurrentEvent();
+            Element target = DOM.eventGetTarget(event);
+                        
+            if(target.toString().toUpperCase().trim().indexOf("</A>") != -1)
+            {               
+               String link = DOM.getElementAttribute(target, "HREF");
+               
+               //A link inside the portlet window was clicked
+               //Load its content asynchronously inside this window
+               boolean isPartialRefreshAllowed = isPartialRefreshAllowed(link);               
+               if(isPartialRefreshAllowed)
+               {
+                  DOM.eventPreventDefault(event);
+                  handlePartialRefreshLink(link, sender);
+               }
+            }
+            else if(target.toString().toUpperCase().trim().indexOf("INPUT") != -1 &&
+                    target.toString().toUpperCase().trim().indexOf("SUBMIT") != -1
+            )
+            {               
+               Element currentForm = DOM.getParent(target);
+               String enctype = DOM.getElementAttribute(currentForm, "enctype");
+               String action = DOM.getElementAttribute(currentForm, "action");
+               boolean isPartialRefreshAllowed = isPartialRefreshAllowed(action);
+               if((isPartialRefreshAllowed) && (enctype == null || !enctype.equals("multipart/form-data")))
+               {
+                  DOM.eventPreventDefault(event);
+                  
+                  //Call a native javascript function here                  
+                  String method = DOM.getElementAttribute(currentForm, "method");                  
+                  String serializedForm = serializeForm(currentForm);   
+                  
+                  handlePartialRefreshForm(action, method, serializedForm, sender);
+               }
+            }
+         } 
+      };*/
+      
+      //Dispalying the fully aggregated page
+      Window[] windows = portalPage.getWindows();
+      HorizontalPanel page = (HorizontalPanel)RootPanel.get("currentPage").getWidget(0);
+      page.clear();
+      for(int i=0; i<windows.length; i++)
+      {
+         Window pageWindow = windows[i]; 
+         if(pageWindow.isVisible())
+         {
+            VerticalPanel window = new VerticalPanel();
+            window.setBorderWidth(2);
+            
+            //Create the decoration panel
+            HorizontalPanel decoration = new HorizontalPanel();
+            decoration.setTitle(pageWindow.getName());
+                        
+            Button normal = new Button("Normal");            
+            Button minimized = new Button("Minimized");            
+            Button maximized = new Button("Maximized");            
+            Button edit = new Button("Edit");            
+            
+            decoration.add(normal);
+            decoration.add(minimized);
+            decoration.add(maximized);
+            decoration.add(edit);
+            window.add(decoration);
+            
+            //Create the actual content of the portlet to be displayed inside the window
+            HTML windowContent = new HTML(pageWindow.getContent());
+            window.add(windowContent);
+                                                            
+            //Event listeners for this Window
+            /*normal.addClickListener(listener);
+            minimized.addClickListener(listener);
+            maximized.addClickListener(listener);
+            edit.addClickListener(listener);
+            windowContent.addClickListener(contentListener);*/
+            
+            //Add this window to the Page
+            page.add(window);            
+         }
+      }      
+   }   
+   //-------------------------------------------------------------------------------------------------------------------------------------------------
+   /**
+    * 
     * @param window
     * @param newState
     */
-   private void handleWindowStateChanged(String window, String newState)
+   /*private void handleWindowStateChanged(String window, String newState)
    {
       PortletServiceAsync portletService = (PortletServiceAsync)GWT.create(PortletService.class);      
-      ((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portletService");
+      ((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
       
       AsyncCallback callback = new AsyncCallback()
       {
@@ -107,17 +209,17 @@
       };
       
       portletService.setState(window, newState, callback);
-   }
+   }*/
    
    /**
     * 
     * @param window
     * @param newState
     */
-   private void handleWindowModeChanged(String window, String newMode)
+   /*private void handleWindowModeChanged(String window, String newMode)
    {
       PortletServiceAsync portletService = (PortletServiceAsync)GWT.create(PortletService.class);      
-      ((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portletService");
+      ((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
       
       AsyncCallback callback = new AsyncCallback()
       {
@@ -133,24 +235,24 @@
       };
       
       portletService.setMode(window, newMode, callback);
-   }
+   }*/
    
    /**
     * 
     * @param url
     * @param portletWindow
     */
-   private void handlePartialRefreshLink(String url, Widget windowContent)
+   /*private void handlePartialRefreshLink(String url, Widget windowContent)
    {
       HTTPRequest.asyncGet(url, new ResponseTextHandlerImpl(windowContent));
-   }
+   }*/
    
    /**
     * 
     * @param url
     * @param portletWindow
     */
-   private void handlePartialRefreshForm(String url, String method, String postData, Widget windowContent)
+   /*private void handlePartialRefreshForm(String url, String method, String postData, Widget windowContent)
    {                  
       if(method.equalsIgnoreCase("post"))
       {
@@ -164,14 +266,14 @@
          }
          HTTPRequest.asyncGet(url, new ResponseTextHandlerImpl(windowContent));
       }
-   }
+   }*/
    
    /**
     * 
     * @author soshah
     *
     */
-   private class ResponseTextHandlerImpl implements ResponseTextHandler
+   /*private class ResponseTextHandlerImpl implements ResponseTextHandler
    {
       private Widget windowContent = null;
       
@@ -186,14 +288,14 @@
          this.windowContent.removeFromParent();
          window.add(html);
       } 
-   }
+   }*/
    
    /**
     * 
     * @param url
     * @return
     */
-   private boolean isPartialRefreshAllowed(String url)
+   /*private boolean isPartialRefreshAllowed(String url)
    {      
       String basePortalURL = GWT.getModuleBaseURL();
       String portalContext = "org.jboss.portal.uiserver.Portal"; //This is hard coded for now, but must be populated from the Portal deployment environment
@@ -259,7 +361,7 @@
          //If I get here, Async Page Refresh through the Portal should be allowed
          return true;
       }
-   }
+   }*/
    
    /**
     * 
@@ -270,160 +372,5 @@
    /*-{      
       var formData = $wnd.Form.serialize(currentForm);
       return formData;
-   }-*/;
-   
-   /**
-    * 
-    * @param portalPage
-    */
-   private void displayPortalPage(Page portalPage)
-   {            
-      //Event Listener for the decoration components like
-      //Normal, Maximized, Minimized
-      ClickListener listener = new ClickListener()
-      {
-         public void onClick(Widget sender)
-         {   
-            Button cour = (Button)sender;
-            String windowName = sender.getParent().getTitle();
-            if(cour.getText().equals("Normal"))
-            {
-               handleWindowStateChanged(windowName, Window.NORMAL);
-            }
-            else if(cour.getText().equals("Minimized"))
-            {
-               handleWindowStateChanged(windowName, Window.MINIMIZED);
-            }
-            else if(cour.getText().equals("Maximized"))
-            {
-               handleWindowStateChanged(windowName, Window.MAXIMIZED);
-            }
-            else if(cour.getText().equals("Edit"))
-            {
-               handleWindowModeChanged(windowName, Window.EDIT);
-            }
-         } 
-      };
-      
-      //Event Listener for actions perfomed inside the portlet window content
-      //itself.
-      ClickListener contentListener = new ClickListener()
-      {
-         public void onClick(Widget sender)
-         {
-            Event event = DOM.eventGetCurrentEvent();
-            Element target = DOM.eventGetTarget(event);
-                        
-            if(target.toString().toUpperCase().trim().indexOf("</A>") != -1)
-            {               
-               String link = DOM.getElementAttribute(target, "HREF");
-               
-               //A link inside the portlet window was clicked
-               //Load its content asynchronously inside this window
-               boolean isPartialRefreshAllowed = isPartialRefreshAllowed(link);               
-               if(isPartialRefreshAllowed)
-               {
-                  DOM.eventPreventDefault(event);
-                  handlePartialRefreshLink(link, sender);
-               }
-            }
-            else if(target.toString().toUpperCase().trim().indexOf("INPUT") != -1 &&
-                    target.toString().toUpperCase().trim().indexOf("SUBMIT") != -1
-            )
-            {               
-               Element currentForm = DOM.getParent(target);
-               String enctype = DOM.getElementAttribute(currentForm, "enctype");
-               String action = DOM.getElementAttribute(currentForm, "action");
-               boolean isPartialRefreshAllowed = isPartialRefreshAllowed(action);
-               if((isPartialRefreshAllowed) && (enctype == null || !enctype.equals("multipart/form-data")))
-               {
-                  DOM.eventPreventDefault(event);
-                  
-                  //Call a native javascript function here                  
-                  String method = DOM.getElementAttribute(currentForm, "method");                  
-                  String serializedForm = serializeForm(currentForm);   
-                  
-                  handlePartialRefreshForm(action, method, serializedForm, sender);
-               }
-            }
-         } 
-      };
-      
-      //Dispalying the fully aggregated page
-      Window[] windows = portalPage.windows;
-      HorizontalPanel page = (HorizontalPanel)RootPanel.get("currentPage").getWidget(0);
-      page.clear();
-      for(int i=0; i<windows.length; i++)
-      {
-         Window pageWindow = windows[i]; 
-         if(pageWindow.isVisible)
-         {
-            VerticalPanel window = new VerticalPanel();
-            window.setBorderWidth(2);
-            
-            //Create the decoration panel
-            HorizontalPanel decoration = new HorizontalPanel();
-            decoration.setTitle(pageWindow.name);
-                        
-            Button normal = new Button("Normal");            
-            Button minimized = new Button("Minimized");            
-            Button maximized = new Button("Maximized");            
-            Button edit = new Button("Edit");            
-            
-            decoration.add(normal);
-            decoration.add(minimized);
-            decoration.add(maximized);
-            decoration.add(edit);
-            window.add(decoration);
-            
-            //Create the actual content of the portlet to be displayed inside the window
-            HTML windowContent = new HTML(pageWindow.content);
-            window.add(windowContent);
-                                                            
-            //Event listeners for this Window
-            normal.addClickListener(listener);
-            minimized.addClickListener(listener);
-            maximized.addClickListener(listener);
-            edit.addClickListener(listener);
-            windowContent.addClickListener(contentListener);
-            
-            //Add this window to the Page
-            page.add(window);            
-         }
-      }
-   }
-   
-   //------------Page Navigation related logic-----------------------------------------------------------------------------------------------------
-   /**
-    * 
-    */
-   private class TabListenerImpl implements TabListener
-   {
-      /**
-       * 
-       */
-      public boolean onBeforeTabSelected(SourcesTabEvents sender, int tabIndex)
-      {
-         return true;
-      }
-
-      /**
-       * 
-       */
-      public void onTabSelected(SourcesTabEvents sender, int tabIndex)
-      {
-         if(tabIndex == 0)
-         {
-            loadPartialRefreshPage("Page 1");
-         }
-         else if(tabIndex == 1)
-         {
-            loadPartialRefreshPage("Page 2");
-         }
-         else if(tabIndex == 2)
-         {
-            loadPartialRefreshPage("Page 3");
-         }
-      }      
-   }
+   }-*/;         
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PortletService.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PortletService.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PortletService.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -37,5 +37,5 @@
     * @param newMode
     * @return
     */
-   public Page setMode(String window, String newMode);
+   public Page setMode(String window, String newMode);   
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PortletServiceAsync.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PortletServiceAsync.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/PortletServiceAsync.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -31,5 +31,5 @@
     * @param newMode
     * @return
     */
-   public void setMode(String window, String newMode, AsyncCallback callback);
+   public void setMode(String window, String newMode, AsyncCallback callback);   
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Window.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Window.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Window.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -1,8 +1,8 @@
 package org.jboss.portal.uiserver.ajax.client;
 
-import java.io.Serializable;
+import com.google.gwt.user.client.rpc.IsSerializable;
 
-public class Window implements Serializable
+public class Window implements IsSerializable
 {
    public static final String NORMAL = "NORMAL";
    public static final String MAXIMIZED = "MAXIMIZED";
@@ -10,9 +10,99 @@
    public static final String EDIT = "EDIT";
    public static final String VIEW = "VIEW";
    
-   public String name = null;
-   public String content = null;
-   public String mode = VIEW;
-   public String state = NORMAL;
-   public boolean isVisible = true;
+   private String name = null;
+   private String content = null;
+   private String mode = VIEW;
+   private String state = NORMAL;
+   private boolean isVisible = true;
+   
+   /**
+    * 
+    * @return
+    */
+   public String getContent()
+   {
+      return content;
+   }
+   
+   /**
+    * 
+    * @param content
+    */
+   public void setContent(String content)
+   {
+      this.content = content;
+   }
+   
+   /**
+    * 
+    * @return
+    */
+   public boolean isVisible()
+   {
+      return isVisible;
+   }
+   
+   /**
+    * 
+    * @param isVisible
+    */
+   public void setVisible(boolean isVisible)
+   {
+      this.isVisible = isVisible;
+   }
+   
+   /**
+    * 
+    * @return
+    */
+   public String getMode()
+   {
+      return mode;
+   }
+   
+   /**
+    * 
+    * @param mode
+    */
+   public void setMode(String mode)
+   {
+      this.mode = mode;
+   }
+   
+   /**
+    * 
+    * @return
+    */
+   public String getName()
+   {
+      return name;
+   }
+   
+   /**
+    * 
+    * @param name
+    */
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   /**
+    * 
+    * @return
+    */
+   public String getState()
+   {
+      return state;
+   }
+   
+   /**
+    * 
+    * @param state
+    */
+   public void setState(String state)
+   {
+      this.state = state;
+   }
 }

Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/PortalRPC.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/PortalRPC.java	                        (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/PortalRPC.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -0,0 +1,25 @@
+package org.jboss.portal.uiserver.ajax.client.service;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+import org.jboss.portal.uiserver.ajax.client.Page;
+
+/**
+ * 
+ * @author soshah
+ *
+ */
+public interface PortalRPC extends RemoteService
+{   
+   /**
+    * Loads the initial Portal Page at the start of a Portal session
+    * 
+    * @return The Initial Portal Page
+    */
+   public Page loadPortal();
+   
+   /**
+    * @return The Page of the Portal that should be currently displayed
+    */
+   public Page getCurrentPage();
+}

Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/PortalRPCAsync.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/PortalRPCAsync.java	                        (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/service/PortalRPCAsync.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -0,0 +1,16 @@
+package org.jboss.portal.uiserver.ajax.client.service;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public interface PortalRPCAsync
+{   
+   /**
+    * Loads the initial Portal Page at the start of a Portal session
+    */
+   public void loadPortal(AsyncCallback callback);
+   
+   /**
+    * Loads the Page of the Portal that should be currently displayed
+    */
+   public void getCurrentPage(AsyncCallback callback);
+}

Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/EntryPoint.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/EntryPoint.java	                        (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/EntryPoint.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.uiserver.service;
+
+import org.jboss.portal.server.RequestControllerFactory;
+import org.jboss.portal.server.Server;
+import org.jboss.portal.common.invocation.InterceptorStackFactory;
+
+/**
+ * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
+ *
+ */
+public interface EntryPoint
+{
+   /**
+    * 
+    * @return
+    */
+   public Server getPortalServer();
+   
+   /**
+    * 
+    * @return
+    */
+   public RequestControllerFactory getControllerFactory();
+   
+   /**
+    * 
+    * @return
+    */
+   public InterceptorStackFactory getInterceptorStackFactory();
+   
+   /**
+    * 
+    * @param contentType
+    * @return
+    */
+   public String retrieveMediaType(String contentType);
+}

Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/EntryPointImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/EntryPointImpl.java	                        (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/EntryPointImpl.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -0,0 +1,135 @@
+/******************************************************************************
+ * 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.uiserver.service;
+
+import org.jboss.portal.common.invocation.InterceptorStackFactory;
+import org.jboss.portal.server.RequestControllerFactory;
+import org.jboss.portal.server.Server;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+/**
+ * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
+ *
+ */
+public class EntryPointImpl extends AbstractJBossService implements EntryPoint
+{
+   /** The interceptor stack. */
+   private InterceptorStackFactory interceptorStackFactory = null;
+
+   /** The controller for this servlet. */
+   private RequestControllerFactory controllerFactory = null;
+   
+   /**
+    * 
+    */
+   private Server portalServer = null;
+
+         
+   /**
+    * 
+    * @return
+    */
+   public RequestControllerFactory getControllerFactory()
+   {
+      return controllerFactory;
+   }
+
+
+   /**
+    * 
+    * @param controllerFactory
+    */
+   public void setControllerFactory(RequestControllerFactory controllerFactory)
+   {
+      this.controllerFactory = controllerFactory;
+   }
+
+   
+   /**
+    * 
+    * @return
+    */
+   public InterceptorStackFactory getInterceptorStackFactory()
+   {
+      return interceptorStackFactory;
+   }
+
+
+   /**
+    * 
+    * @param interceptorStackFactory
+    */
+   public void setInterceptorStackFactory(
+         InterceptorStackFactory interceptorStackFactory)
+   {
+      this.interceptorStackFactory = interceptorStackFactory;
+   }
+   
+   /**
+    * 
+    * @return
+    */
+   public Server getPortalServer()
+   {
+      return portalServer;
+   }
+
+
+   /**
+    * 
+    * @param portalServer
+    */
+   public void setPortalServer(Server portalServer)
+   {
+      this.portalServer = portalServer;
+   }
+
+
+   /**
+    * 
+    * @param contentType
+    * @return
+    */
+   public String retrieveMediaType(String contentType)
+   {
+      String mediaType = contentType;
+
+      //
+      if (mediaType != null)
+      {
+         // Remove any parameters
+         int index = mediaType.indexOf(';');
+         if (index != -1)
+         {
+            mediaType = contentType.substring(0, index);
+         }
+
+         // Trim
+         mediaType = mediaType.trim();
+
+         // Media type matching is case insensitive, so we convert to lower case
+         mediaType = mediaType.toLowerCase();
+      }
+      return mediaType;
+   }
+}

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/GWTClientFilter.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/GWTClientFilter.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/GWTClientFilter.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -55,6 +55,8 @@
       HttpServletRequest request = (HttpServletRequest)servletRequest;
       HttpServletResponse response = (HttpServletResponse)servletResponse;
       String contextPath = request.getContextPath();
+      
+      //Extract the resource that is being accessed
       String resource = request.getRequestURI().replaceFirst(contextPath, "");
       while(resource.startsWith("/"))
       {
@@ -89,9 +91,6 @@
          response.getOutputStream().flush();
          return;
       }
-      
-      //Propagate the request further
-      filterChain.doFilter(servletRequest, servletResponse);
    }
 
    /**

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -23,11 +23,12 @@
 package org.jboss.portal.uiserver.service;
 
 import java.io.IOException;
-import java.io.InputStream;
+import java.io.PrintWriter;
 import java.nio.charset.Charset;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import javax.management.MBeanServer;
@@ -37,6 +38,7 @@
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.servlet.UnavailableException;
 
 import org.apache.log4j.Logger;
 import org.jboss.mx.util.MBeanProxy;
@@ -58,6 +60,16 @@
 import org.jboss.portal.server.ServerResponse;
 import org.jboss.portal.server.impl.ServerInvocationContextImpl;
 import org.jboss.portal.server.request.URLContext;
+import org.jboss.portal.uiserver.layout.LayoutManager;
+import org.jboss.portal.uiserver.layout.classic.FlexibleGrid;
+import org.jboss.portal.uiserver.layout.classic.FlexibleGridConstraints;
+import org.jboss.portal.uiserver.layout.classic.FlexibleGridLayoutManager;
+import org.jboss.portal.uiserver.layout.classic.RegionConstraints;
+import org.jboss.portal.uiserver.layout.classic.RegionLayoutManager;
+import org.jboss.portal.uiserver.protocol.Container;
+import org.jboss.portal.uiserver.protocol.Page;
+import org.jboss.portal.uiserver.protocol.Window;
+import org.jboss.portal.uiserver.processor.ProcessorResponse;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -65,6 +77,11 @@
  */
 public class PortalEntryPoint extends HttpServlet
 {
+   /**
+    * 
+    */
+   private Logger log = Logger.getLogger(getClass());
+   
    /** . */
    private static final int GET_METHOD = 0;
 
@@ -79,115 +96,38 @@
 
    /** Describes a path mapping. */
    private static final int PATH_MAPPING = 2;
-
-   /** The logger. */
-   protected Logger log = Logger.getLogger(getClass());
-
-   /** The server. */
-   private Server server;
-
-   /** The interceptor stack. */
-   private InterceptorStackFactory interceptorStack;
-
+   
    /** Are we or not the default servlet ? */
-   private boolean asDefaultServlet;
-
-   /** The controller for this servlet. */
-   private RequestControllerFactory controllerFactory;
-
-   /** The controller name. */
-   private String controllerFactoryName;
-
+   private boolean asDefaultServlet = false;
+   
+   /**
+    * 
+    */
+   private EntryPoint entryPoint = null;
+   
    /** Configure the as default servlet. */
    public void init() throws ServletException
    {
       asDefaultServlet = getAsDefaultServletInitValue();
-      controllerFactoryName = getServletConfig().getInitParameter("controllerFactoryName");
-   }
-
-   /**
-    *
-    */
-   protected final Server getServer()
-   {
-      if (server == null)
+      try
       {
-         try
-         {
-            MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
-            server = (Server)MBeanProxy.get(Server.class, new ObjectName("portal:service=Server"), mbeanServer);
-         }
-         catch (Exception e)
-         {
-            String msg = "Cannot get portal server";
-            log.error(msg, e);
-            throw new IllegalStateException(msg);
-         }
+         MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+         this.entryPoint = (EntryPoint) MBeanProxy.get(EntryPoint.class, new ObjectName(
+               this.getInitParameter("entryPointServiceName")),
+               mbeanServer);
       }
-      return server;
-   }
-
-   protected final InterceptorStackFactory getInterceptorStackFactory()
-   {
-      if (interceptorStack == null)
+      catch (Exception e)
       {
-         try
-         {
-            MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
-            interceptorStack = (InterceptorStackFactory)MBeanProxy.get(InterceptorStackFactory.class, new ObjectName("portal:service=InterceptorStackFactory,type=Server"), mbeanServer);
-         }
-         catch (Exception e)
-         {
-            String msg = "Cannot get interceptor stack";
-            log.error(msg, e);
-            throw new IllegalStateException(msg);
-         }
+         this.entryPoint = null;
+         String msg = "Portal Entry Point could not be created";
+         log.error(msg, e);
+         throw new UnavailableException(msg);
       }
-      return interceptorStack;
    }
-
-   protected final RequestControllerFactory getControllerFactory()
-   {
-      if (controllerFactory == null)
-      {
-         try
-         {
-            MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
-            controllerFactory = (RequestControllerFactory)MBeanProxy.get(RequestControllerFactory.class, new ObjectName(controllerFactoryName), mbeanServer);
-         }
-         catch (Exception e)
-         {
-            String msg = "Cannot get controller " + controllerFactoryName;
-            log.error(msg, e);
-            throw new IllegalStateException(msg);
-         }
-      }
-      return controllerFactory;
-   }
-
-   private String retrieveMediaType(String contentType)
-   {
-      String mediaType = contentType;
-
-      //
-      if (mediaType != null)
-      {
-         // Remove any parameters
-         int index = mediaType.indexOf(';');
-         if (index != -1)
-         {
-            mediaType = contentType.substring(0, index);
-         }
-
-         // Trim
-         mediaType = mediaType.trim();
-
-         // Media type matching is case insensitive, so we convert to lower case
-         mediaType = mediaType.toLowerCase();
-      }
-      return mediaType;
-   }
-
+   
+   /**
+    * 
+    */
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
    {
       //
@@ -229,7 +169,7 @@
       }
 
       // Compute the media type in the content type
-      String mediaType = retrieveMediaType(req.getContentType());
+      String mediaType = this.entryPoint.retrieveMediaType(req.getContentType());
 
       // Only affect the charset encoding if the servlet container will decode the request
       if (method == POST_METHOD && PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED.equals(mediaType))
@@ -359,7 +299,7 @@
       // ***************
 
       //
-      Server server = getServer();
+      Server server = this.entryPoint.getPortalServer();
 
       //
       ServerInvocationContext invocationCtx = new ServerInvocationContextImpl(
@@ -386,15 +326,25 @@
       invocation.setResponse(response);
 
       //
-      RequestControllerFactory controllerFactory = getControllerFactory();
+      RequestControllerFactory controllerFactory = this.entryPoint.getControllerFactory();
       RequestController controller = controllerFactory.createRequestController(invocation);
       invocation.setHandler(new RequestControllerDispatcher(controller));
 
       //
       try
       {
-         InterceptorStackFactory stack = getInterceptorStackFactory();
+         InterceptorStackFactory stack = this.entryPoint.getInterceptorStackFactory();
          invocation.invoke(stack.getInterceptorStack());
+         ProcessorResponse processorResponse = (ProcessorResponse)req.getAttribute("processorResponse");
+         if(processorResponse != null)
+         {
+            Page displayedPage = processorResponse.findDisplayedPage();
+            if(displayedPage != null)
+            {
+               this.render(invocation.getServerContext().getClientResponse().getWriter(), 
+               displayedPage);
+            }
+         }
       }
       catch (ServerException e)
       {
@@ -422,14 +372,13 @@
          Throwable nested = Exceptions.unwrap(e);
          throw new ServletException(nested);
       }
-   }
+   } 
    
-   
    /**
-    * Return the value for the servlet mapping. This implementation get the value from an init parameter of the servlet
-    * called <b>asDefaultServlet</b>
+    * Return the value for the servlet mapping. This implementation get the
+    * value from an init parameter of the servlet called <b>asDefaultServlet</b>
     */
-   protected boolean getAsDefaultServletInitValue()
+   private boolean getAsDefaultServletInitValue()
    {
       ServletConfig config = getServletConfig();
       String value = config.getInitParameter("asDefaultServlet");
@@ -445,8 +394,238 @@
       }
       else
       {
-         log.warn("Servlet mapping cannot be determined with init parameter value=" + value);
+         log.warn("Servlet mapping cannot be determined with init parameter value="
+                     + value);
          return false;
       }
+   }   
+   // ---------All these are just helper methods for the prototype-----------------------------------------------------------------------------------------------
+   //----It containts mostly hard coded logic for the prototype-------------------------------------------------------------------------------------------------
+   /**
+    * Based on the latest design discussion, this method is not needed.
+    * 
+    * This will be an implementation detail of the UIServer processing the Response that is sent back to it
+    * from the Core Portal Processor
+    * 
+    * @param clientConnection
+    * @param page
+    */
+   private void render(PrintWriter clientConnection, Page pageResult)
+   {
+      /**
+       * Special Note: Currently this prototype code and layout configuration including page result creation is hard coded for the purpose
+       * of getting the architecture right
+       * 
+       * In the real implementation, LayoutState would be fetched dynamically based on the Page State/Configuration being rendered
+       * Even type of Client considerations would be handled here
+       * 
+       * Basically the UIServer would delegate functions to its various components and then send back the result to the client
+       * 
+       */      
+      //Some flexible grid layout testing code
+      Object[] gridData = this.getFlexibleGridLayoutManager(pageResult);
+      Page page = (Page)gridData[0];
+      LayoutManager layoutManager = (LayoutManager)gridData[1]; 
+      
+      //Some region layout testing code
+      //Object[] regionData = this.getRegionBasedLayoutManager(pageResult);
+      //Page page = (Page)regionData[0];
+      //LayoutManager layoutManager = (LayoutManager)regionData[1];
+            
+      //Peform Page Layout
+      String output = layoutManager.doLayout(page);
+      
+      
+      //Create the final output...Also hardcoded without any preprocessing/postprocessing etc
+      StringBuffer buffer = new StringBuffer();      
+      buffer.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>JBoss Portal UIServer</title><link rel=\"stylesheet\" id=\"dyna_css\" href=\"/portal-ajax/dyna/style.css\" type=\"text/css\"/><link rel=\"stylesheet\" type=\"text/css\" id=\"main_css\" href=\"/portal-core/themes/renaissance/portal_style.css\"/><link rel=\"shortcut icon\" href=\"/portal-core/themes/renaissance/images/favicon.ico\" /><link rel=\"icon\" type=\"image/gif\" href=\"/portal-core/themes/renaissance/images/animated_favicon1.gif\" /></head><body id=\"body\">\n");
+      buffer.append(output);
+      buffer.append("</body></html>\n");
+      
+      
+      //Sending the results back to the Client
+      clientConnection.write(buffer.toString());
+      clientConnection.flush();
    }
+   
+   /**
+    * 
+    */
+   private Object[] getFlexibleGridLayoutManager(Page pageResult)
+   {
+      /**
+       * Hard coding the FlexibleGridLayout Management here
+       */
+      Page page = new Page();
+      Container header = new Container("header");
+      Container leftPanel = new Container("leftPanel");
+      Container mainPanel = new Container("mainPanel");
+      Window headerTabsWindow = new Window("header-tabs-window");
+      Window menuWindow = new Window("menu-window");
+      Window leftPanelWindow1 = new Window("left-panel-window1");
+      Window leftPanelWindow2 = new Window("left-panel-window2");
+      Window mainPanelWindow = new Window("main-panel-window");
+      header.addComponent(headerTabsWindow);
+      header.addComponent(menuWindow);
+      leftPanel.addComponent(leftPanelWindow1);
+      leftPanel.addComponent(leftPanelWindow2);
+      mainPanel.addComponent(mainPanelWindow);
+            
+      //Setup the Grid for headerTabs container
+      page.addContainer(header);
+      FlexibleGrid headerGrid = this.getGrid("header", 1, 2);
+      FlexibleGridConstraints[] headerTabConstraints  = { this.getConstraints("header-tabs-window", "100", 0, 0, 10, 0, 0, 0),
+      this.getConstraints("menu-window", "100", 0, 0, 0, 0, 0, 1) };
+      headerGrid.setConstraints(headerTabConstraints);      
+      
+      //Setup the Grid for left panel container
+      page.addContainer(leftPanel);
+      FlexibleGrid leftPanelGrid = this.getGrid("leftPanel", 2, 1);
+      FlexibleGridConstraints[] leftPanelConstraints  = { this.getConstraints("left-panel-window1", "75", 0, 0, 0, 0, 0, 0), 
+      this.getConstraints("left-panel-window2", "75", 0, 0, 0, 0, 1, 0) };      
+      leftPanelGrid.setConstraints(leftPanelConstraints);
+      
+      //Setup the Grid for main panel container
+      page.addContainer(mainPanel);
+      FlexibleGrid mainPanelGrid = this.getGrid("mainPanel", 1, 1);
+      FlexibleGridConstraints[] mainPanelConstraints  = { this.getConstraints("main-panel-window", "100", 0, 0, 0, 0, 0, 0) };
+      mainPanelGrid.setConstraints(mainPanelConstraints);
+      
+      //Setup the FlexibleGrid Layout Manager with the different grids
+      FlexibleGrid[] row1 = { headerGrid };
+      FlexibleGrid[] row2 = { leftPanelGrid, mainPanelGrid };
+      FlexibleGridLayoutManager layoutManager = new FlexibleGridLayoutManager();
+      layoutManager.addRowOfGrids(row1);
+      layoutManager.addRowOfGrids(row2);
+            
+      //Populate the grid windows with proper content      
+      List windows = pageResult.getWindows();
+      int counter = 0;
+      for(Iterator itr=windows.iterator();itr.hasNext();)
+      {
+         Window result = (Window)itr.next();
+         
+         switch(counter)
+         {
+            case 0:
+               leftPanelWindow1.setContent(result.getContent());
+            break;
+            
+            case 1:
+               leftPanelWindow2.setContent(result.getContent());
+            break;
+               
+            case 2:
+               mainPanelWindow.setContent(result.getContent());
+            break;
+               
+            case 3:
+               menuWindow.setContent(result.getContent());
+            break;
+               
+            case 4:
+               headerTabsWindow.setContent(result.getContent());
+            break;
+         }
+         
+         counter++;         
+      }
+      
+      return new Object[]{page, layoutManager};
+   }
+      
+   
+   /**
+    * 
+    * @param containerId
+    * @param rows
+    * @param columns
+    * @return
+    */
+   private FlexibleGrid getGrid(String containerId,int rows, int columns)
+   {
+      FlexibleGrid grid = new FlexibleGrid(containerId);
+      grid.setRows(rows);
+      grid.setColumns(columns);
+      return grid;
+   }
+   
+   /**
+    * 
+    * @param componentId
+    * @param widthPercentage
+    * @param top
+    * @param bottom
+    * @param left
+    * @param right
+    */
+   private FlexibleGridConstraints getConstraints(String componentId, String widthPercentage, int top, int bottom, int left, int right, int row, int column)
+   {
+      FlexibleGridConstraints constraints = new FlexibleGridConstraints();
+      constraints.setComponentId(componentId);
+      constraints.setWidthPercentage(widthPercentage);
+      constraints.setRow(row);
+      constraints.setColumn(column);
+      constraints.setTop(top);
+      constraints.setBottom(bottom);
+      constraints.setLeft(left);
+      constraints.setRight(right);
+      return constraints;
+   }
+   
+   /**
+    * 
+    * @param pageResult
+    * @return
+    */
+   private Object[] getRegionBasedLayoutManager(Page pageResult)
+   {
+      Page page = new Page();
+      Container left = new Container("left");
+      Container center = new Container("center");
+      page.addContainer(left);
+      page.addContainer(center);
+            
+      //Populate the grid windows with proper content      
+      List windows = pageResult.getWindows();
+      int counter = 0;
+      for(Iterator itr=windows.iterator();itr.hasNext();)
+      {
+         Window result = (Window)itr.next();
+         Window uiWindow = new Window(result.getId());
+         uiWindow.setContent(result.getContent());
+         switch(counter)
+         {
+            case 0:
+               left.addComponent(uiWindow);
+            break;
+            
+            case 1:
+               left.addComponent(uiWindow);
+            break;
+               
+            case 2:
+               center.addComponent(uiWindow);
+            break;
+               
+            case 3:
+               center.addComponent(uiWindow);
+            break;
+               
+            case 4:
+               left.addComponent(uiWindow);
+            break;
+         }
+         
+         counter++;         
+      }
+      
+      RegionLayoutManager layoutManager = new RegionLayoutManager();
+      RegionConstraints leftConstraints = new RegionConstraints("left", RegionConstraints.LEFT);
+      RegionConstraints centerConstraints = new RegionConstraints("center", RegionConstraints.CENTER);
+      layoutManager.addRegionConstraints(leftConstraints);
+      layoutManager.addRegionConstraints(centerConstraints);
+      
+      return new Object[]{page, layoutManager};
+   }
 }

Deleted: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortletServiceImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortletServiceImpl.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortletServiceImpl.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -1,224 +0,0 @@
-package org.jboss.portal.uiserver.service;
-
-import java.io.InputStream;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.jboss.portal.uiserver.ajax.client.PortletService;
-import org.jboss.portal.uiserver.ajax.client.Page;
-import org.jboss.portal.uiserver.ajax.client.Window;
-
-import com.google.gwt.user.server.rpc.RemoteServiceServlet;
-
-/**
- * This is just a STUB server side component to test the client side components of the GWT-based AJAX UI
- * 
- * In real implementation this functionality will be provided by the UIServer interfacing with the Portal Core
- * 
- * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
- *
- */
-public class PortletServiceImpl extends RemoteServiceServlet implements PortletService
-{
-
-   /**
-    * 
-    */
-   public String getPortlet(String portletId)
-   {  
-      String portletContent = null;
-      
-      String contentPath = portletId;      
-      InputStream is = null;
-      try
-      {
-         is = Thread.currentThread().getContextClassLoader().getResourceAsStream(contentPath);
-         StringBuffer contentBuffer = new StringBuffer();
-         int bytesRead = 0;
-         byte[] data = new byte[1024];
-         while((bytesRead=is.read(data)) != -1)
-         {
-            byte[] cour = new byte[bytesRead];
-            System.arraycopy(data, 0, cour, 0, bytesRead);
-            contentBuffer.append(new String(cour));
-         }         
-         portletContent = contentBuffer.toString();
-      }
-      catch(Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-      finally
-      {
-         if(is != null)
-         {
-            try{is.close();}catch(Exception e){}
-         }
-      }
-      
-      return portletContent;
-   }
-   
-   /**
-    * 
-    * @param pageId
-    * @return
-    */
-   public Page getPage(String pageId)
-   {
-      Page page = new Page();
-      page.name = pageId;
-      
-      if(pageId.equals("index") || pageId.equals("Page 1"))
-      {
-         String weatherContent = this.getPortlet("weatherPortlet.html");
-         String cmsContent = this.getPortlet("cmsPortlet.html");
-         Window[] windows = new Window[2];
-         page.windows = windows;
-         
-         
-         Window weatherWindow = new Window();
-         weatherWindow.name = "weatherPortlet";
-         weatherWindow.content = weatherContent;
-         
-         Window cmsWindow = new Window();
-         cmsWindow.name = "cmsPortlet";
-         cmsWindow.content = cmsContent;
-               
-         windows[0] = weatherWindow;
-         windows[1] = cmsWindow;
-      }
-      else if(pageId.equals("Page 2"))
-      {
-         String weatherContent = this.getPortlet("weatherPortlet.html");         
-         Window[] windows = new Window[1];
-         page.windows = windows;
-         
-         
-         Window weatherWindow = new Window();
-         weatherWindow.name = "weatherPortlet";
-         weatherWindow.content = weatherContent;         
-               
-         windows[0] = weatherWindow;
-      }
-      else if(pageId.equals("Page 3"))
-      {
-         String cmsContent = this.getPortlet("cmsPortlet.html");
-         Window[] windows = new Window[1];
-         page.windows = windows;
-                  
-         Window cmsWindow = new Window();
-         cmsWindow.name = "cmsPortlet";
-         cmsWindow.content = cmsContent;
-               
-         windows[0] = cmsWindow;
-      }
-      
-      HttpServletRequest request = this.getThreadLocalRequest();
-      request.getSession().setAttribute("currentPage", page);
-      
-      return page;
-   }
-   
-   /**
-    * 
-    * @param window
-    * @param state
-    */
-   public Page setState(String window, String newState)
-   {
-      HttpServletRequest request = this.getThreadLocalRequest();
-      Page page = (Page)request.getSession().getAttribute("currentPage");
-      
-      Window selectedWindow = this.findWindow(page, window);
-      selectedWindow.state = newState;
-      if(selectedWindow.state.equals(Window.NORMAL))
-      {
-         if(selectedWindow.name.equals("cmsPortlet"))
-         {
-            selectedWindow.content = this.getPortlet("cmsPortlet.html");
-         }
-         else
-         {
-            selectedWindow.content = this.getPortlet("weatherPortlet.html");
-         }         
-         this.hideWindows(page.windows, null, false);
-      }
-      else if(selectedWindow.state.equals(Window.MINIMIZED))
-      {
-         selectedWindow.content = "";
-         this.hideWindows(page.windows, null, false);
-      }
-      if(selectedWindow.state.equals(Window.MAXIMIZED))
-      {
-         if(selectedWindow.name.equals("cmsPortlet"))
-         {
-            selectedWindow.content = this.getPortlet("cmsPortlet.html");
-         }
-         else
-         {
-            selectedWindow.content = this.getPortlet("weatherPortlet.html");
-         }
-         this.hideWindows(page.windows, selectedWindow, true);
-      }
-      
-      return page;
-   }
-   
-   /**
-    * 
-    * @param window
-    * @param state
-    */
-   public Page setMode(String window, String newMode)
-   {
-      HttpServletRequest request = this.getThreadLocalRequest();
-      Page page = (Page)request.getSession().getAttribute("currentPage");
-            
-      Window selectedWindow = this.findWindow(page, window);
-      selectedWindow.mode = newMode;
-      
-      return page;
-   }
-   
-   /**
-    * 
-    * @param page
-    * @param windowName
-    * @return
-    */
-   private Window findWindow(Page page, String windowName)
-   {
-      Window window = null;
-      
-      Window[] windows = page.windows;
-      for(int i=0; i<windows.length; i++)
-      {
-         if(windows[i].name.equals(windowName))
-         {
-            window = windows[i];
-            break;
-         }
-      }
-      
-      return window;
-   }
-   
-   /**
-    * 
-    * @param excludedWindow
-    * @param hide
-    */
-   private void hideWindows(Window[] windows, Window excludedWindow, boolean hide)
-   {
-      for(int i=0; i<windows.length; i++)
-      {
-         if(excludedWindow != null && windows[i].name.equals(excludedWindow.name))
-         {
-            continue;
-         }
-         
-         windows[i].isVisible = !hide;
-      }
-   }
-}

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -22,24 +22,11 @@
  ******************************************************************************/
 package org.jboss.portal.uiserver.service;
 
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.List;
 import java.util.StringTokenizer;
 
-import org.jboss.portal.uiserver.protocol.Container;
-import org.jboss.portal.uiserver.protocol.Page;
-import org.jboss.portal.uiserver.protocol.Window;
 import org.jboss.portal.uiserver.protocol.PortalObject;
 import org.jboss.portal.uiserver.protocol.Portal;
-import org.jboss.portal.uiserver.layout.LayoutManager;
-import org.jboss.portal.uiserver.layout.classic.FlexibleGrid;
-import org.jboss.portal.uiserver.layout.classic.FlexibleGridConstraints;
-import org.jboss.portal.uiserver.layout.classic.FlexibleGridLayoutManager;
-import org.jboss.portal.uiserver.layout.classic.RegionLayoutManager;
-import org.jboss.portal.uiserver.layout.classic.RegionConstraints;
 
-
 import org.jboss.portal.uiserver.processor.Processor;
 import org.jboss.portal.uiserver.processor.ProcessorRequest;
 import org.jboss.portal.uiserver.processor.ProcessorResponse;
@@ -159,12 +146,7 @@
          //Go ahead and render to the client based on ProcessorResponse received from the core Portal 
          if(processorResponse != null)
          {
-            Page displayedPage = processorResponse.findDisplayedPage();
-            if(displayedPage != null)
-            {
-               this.render(invocation.getServerContext().getClientResponse().getWriter(), 
-               displayedPage);
-            }
+            invocation.getServerContext().getClientRequest().setAttribute("processorResponse", processorResponse);                        
          }                  
       }
       catch(Exception e)
@@ -206,234 +188,5 @@
    public void setProcessor(Processor processor)
    {
       this.processor = processor;
-   }
-   //---------All these are just helper methods for the prototype-----------------------------------------------------------------------------------------------
-   //----It containts mostly hard coded logic for the prototype-------------------------------------------------------------------------------------------------
-   /**
-    * Based on the latest design discussion, this method is not needed.
-    * 
-    * This will be an implementation detail of the UIServer processing the Response that is sent back to it
-    * from the Core Portal Processor
-    * 
-    * @param clientConnection
-    * @param page
-    */
-   private void render(PrintWriter clientConnection, Page pageResult)
-   {
-      /**
-       * Special Note: Currently this prototype code and layout configuration including page result creation is hard coded for the purpose
-       * of getting the architecture right
-       * 
-       * In the real implementation, LayoutState would be fetched dynamically based on the Page State/Configuration being rendered
-       * Even type of Client considerations would be handled here
-       * 
-       * Basically the UIServer would delegate functions to its various components and then send back the result to the client
-       * 
-       */      
-      //Some flexible grid layout testing code
-      Object[] gridData = this.getFlexibleGridLayoutManager(pageResult);
-      Page page = (Page)gridData[0];
-      LayoutManager layoutManager = (LayoutManager)gridData[1]; 
-      
-      //Some region layout testing code
-      //Object[] regionData = this.getRegionBasedLayoutManager(pageResult);
-      //Page page = (Page)regionData[0];
-      //LayoutManager layoutManager = (LayoutManager)regionData[1];
-            
-      //Peform Page Layout
-      String output = layoutManager.doLayout(page);
-      
-      
-      //Create the final output...Also hardcoded without any preprocessing/postprocessing etc
-      StringBuffer buffer = new StringBuffer();      
-      buffer.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>JBoss Portal UIServer</title><link rel=\"stylesheet\" id=\"dyna_css\" href=\"/portal-ajax/dyna/style.css\" type=\"text/css\"/><link rel=\"stylesheet\" type=\"text/css\" id=\"main_css\" href=\"/portal-core/themes/renaissance/portal_style.css\"/><link rel=\"shortcut icon\" href=\"/portal-core/themes/renaissance/images/favicon.ico\" /><link rel=\"icon\" type=\"image/gif\" href=\"/portal-core/themes/renaissance/images/animated_favicon1.gif\" /></head><body id=\"body\">\n");
-      buffer.append(output);
-      buffer.append("</body></html>\n");
-      
-      
-      //Sending the results back to the Client
-      clientConnection.write(buffer.toString());
-      clientConnection.flush();
-   }
-   
-   /**
-    * 
-    */
-   private Object[] getFlexibleGridLayoutManager(Page pageResult)
-   {
-      /**
-       * Hard coding the FlexibleGridLayout Management here
-       */
-      Page page = new Page();
-      Container header = new Container("header");
-      Container leftPanel = new Container("leftPanel");
-      Container mainPanel = new Container("mainPanel");
-      Window headerTabsWindow = new Window("header-tabs-window");
-      Window menuWindow = new Window("menu-window");
-      Window leftPanelWindow1 = new Window("left-panel-window1");
-      Window leftPanelWindow2 = new Window("left-panel-window2");
-      Window mainPanelWindow = new Window("main-panel-window");
-      header.addComponent(headerTabsWindow);
-      header.addComponent(menuWindow);
-      leftPanel.addComponent(leftPanelWindow1);
-      leftPanel.addComponent(leftPanelWindow2);
-      mainPanel.addComponent(mainPanelWindow);
-            
-      //Setup the Grid for headerTabs container
-      page.addContainer(header);
-      FlexibleGrid headerGrid = this.getGrid("header", 1, 2);
-      FlexibleGridConstraints[] headerTabConstraints  = { this.getConstraints("header-tabs-window", "100", 0, 0, 10, 0, 0, 0),
-      this.getConstraints("menu-window", "100", 0, 0, 0, 0, 0, 1) };
-      headerGrid.setConstraints(headerTabConstraints);      
-      
-      //Setup the Grid for left panel container
-      page.addContainer(leftPanel);
-      FlexibleGrid leftPanelGrid = this.getGrid("leftPanel", 2, 1);
-      FlexibleGridConstraints[] leftPanelConstraints  = { this.getConstraints("left-panel-window1", "75", 0, 0, 0, 0, 0, 0), 
-      this.getConstraints("left-panel-window2", "75", 0, 0, 0, 0, 1, 0) };      
-      leftPanelGrid.setConstraints(leftPanelConstraints);
-      
-      //Setup the Grid for main panel container
-      page.addContainer(mainPanel);
-      FlexibleGrid mainPanelGrid = this.getGrid("mainPanel", 1, 1);
-      FlexibleGridConstraints[] mainPanelConstraints  = { this.getConstraints("main-panel-window", "100", 0, 0, 0, 0, 0, 0) };
-      mainPanelGrid.setConstraints(mainPanelConstraints);
-      
-      //Setup the FlexibleGrid Layout Manager with the different grids
-      FlexibleGrid[] row1 = { headerGrid };
-      FlexibleGrid[] row2 = { leftPanelGrid, mainPanelGrid };
-      FlexibleGridLayoutManager layoutManager = new FlexibleGridLayoutManager();
-      layoutManager.addRowOfGrids(row1);
-      layoutManager.addRowOfGrids(row2);
-            
-      //Populate the grid windows with proper content      
-      List windows = pageResult.getWindows();
-      int counter = 0;
-      for(Iterator itr=windows.iterator();itr.hasNext();)
-      {
-         Window result = (Window)itr.next();
-         
-         switch(counter)
-         {
-            case 0:
-               leftPanelWindow1.setContent(result.getContent());
-            break;
-            
-            case 1:
-               leftPanelWindow2.setContent(result.getContent());
-            break;
-               
-            case 2:
-               mainPanelWindow.setContent(result.getContent());
-            break;
-               
-            case 3:
-               menuWindow.setContent(result.getContent());
-            break;
-               
-            case 4:
-               headerTabsWindow.setContent(result.getContent());
-            break;
-         }
-         
-         counter++;         
-      }
-      
-      return new Object[]{page, layoutManager};
-   }
-      
-   
-   /**
-    * 
-    * @param containerId
-    * @param rows
-    * @param columns
-    * @return
-    */
-   private FlexibleGrid getGrid(String containerId,int rows, int columns)
-   {
-      FlexibleGrid grid = new FlexibleGrid(containerId);
-      grid.setRows(rows);
-      grid.setColumns(columns);
-      return grid;
-   }
-   
-   /**
-    * 
-    * @param componentId
-    * @param widthPercentage
-    * @param top
-    * @param bottom
-    * @param left
-    * @param right
-    */
-   private FlexibleGridConstraints getConstraints(String componentId, String widthPercentage, int top, int bottom, int left, int right, int row, int column)
-   {
-      FlexibleGridConstraints constraints = new FlexibleGridConstraints();
-      constraints.setComponentId(componentId);
-      constraints.setWidthPercentage(widthPercentage);
-      constraints.setRow(row);
-      constraints.setColumn(column);
-      constraints.setTop(top);
-      constraints.setBottom(bottom);
-      constraints.setLeft(left);
-      constraints.setRight(right);
-      return constraints;
-   }
-   
-   /**
-    * 
-    * @param pageResult
-    * @return
-    */
-   private Object[] getRegionBasedLayoutManager(Page pageResult)
-   {
-      Page page = new Page();
-      Container left = new Container("left");
-      Container center = new Container("center");
-      page.addContainer(left);
-      page.addContainer(center);
-            
-      //Populate the grid windows with proper content      
-      List windows = pageResult.getWindows();
-      int counter = 0;
-      for(Iterator itr=windows.iterator();itr.hasNext();)
-      {
-         Window result = (Window)itr.next();
-         Window uiWindow = new Window(result.getId());
-         uiWindow.setContent(result.getContent());
-         switch(counter)
-         {
-            case 0:
-               left.addComponent(uiWindow);
-            break;
-            
-            case 1:
-               left.addComponent(uiWindow);
-            break;
-               
-            case 2:
-               center.addComponent(uiWindow);
-            break;
-               
-            case 3:
-               center.addComponent(uiWindow);
-            break;
-               
-            case 4:
-               left.addComponent(uiWindow);
-            break;
-         }
-         
-         counter++;         
-      }
-      
-      RegionLayoutManager layoutManager = new RegionLayoutManager();
-      RegionConstraints leftConstraints = new RegionConstraints("left", RegionConstraints.LEFT);
-      RegionConstraints centerConstraints = new RegionConstraints("center", RegionConstraints.CENTER);
-      layoutManager.addRegionConstraints(leftConstraints);
-      layoutManager.addRegionConstraints(centerConstraints);
-      
-      return new Object[]{page, layoutManager};
-   }   
+   }      
 }

Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/HostedModeProxy.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/HostedModeProxy.java	                        (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/HostedModeProxy.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * 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.uiserver.service.ajax;
+
+import java.io.ByteArrayInputStream;
+
+import javax.servlet.http.HttpServletRequest;
+
+import com.google.gwt.user.client.rpc.SerializationException;
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.PostMethodWebRequest;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
+
+/**
+ * This is a RPC Proxy Service that is used only during development. This lets the GWT client integrate with the Portal server while running in
+ * Hosted Mode. It is very efficient to debug/develop client side GWT code in Hosted Mode.
+ * 
+ * This service is never deployed in a production setting and Portal components *do not* have any compile time or run time dependency on this Proxy.
+ * 
+ * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
+ *
+ */
+public class HostedModeProxy extends RemoteServiceServlet
+{
+   /**
+    * 
+    */
+   public String processCall(String input) throws SerializationException
+   {
+      try
+      {
+         String response = null;
+         
+         HttpServletRequest request = this.getThreadLocalRequest();
+         
+         //Setup the conversation with the portal server
+         WebConversation wc = null;
+         if(request.getSession().getAttribute("conversation") != null)
+         {
+            wc = (WebConversation)request.getSession().getAttribute("conversation");
+         }
+         else
+         {
+            wc = new WebConversation();
+            request.getSession().setAttribute("conversation", wc);
+         }
+         
+         //Proxy this rpc request over to the Portal server
+         WebRequest post = new PostMethodWebRequest(
+               "http://localhost:8080/portal-uiserver/portalrpc",
+               new ByteArrayInputStream(input.getBytes()),
+               "text/plain; charset=utf-8"
+         );
+         WebResponse webResponse = wc.getResponse(post);
+         response = webResponse.getText();
+         
+         return response;
+      }
+      catch(Exception e)
+      {
+         throw new SerializationException(e);
+      }
+   }
+}

Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortalRPCImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortalRPCImpl.java	                        (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortalRPCImpl.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -0,0 +1,224 @@
+package org.jboss.portal.uiserver.service.ajax;
+
+
+import java.util.Map;
+import java.util.List;
+import java.util.HashMap;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import javax.servlet.ServletException;
+import javax.servlet.UnavailableException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanServerLocator;
+
+import org.jboss.portal.common.invocation.InterceptorStackFactory;
+import org.jboss.portal.server.RequestControllerFactory;
+import org.jboss.portal.server.Server;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portal.server.impl.ServerInvocationContextImpl;
+import org.jboss.portal.server.request.URLContext;
+import org.jboss.portal.server.ServerRequest;
+import org.jboss.portal.server.ServerResponse;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.RequestController;
+import org.jboss.portal.server.RequestControllerDispatcher;
+
+import org.jboss.portal.uiserver.ajax.client.service.PortalRPC;
+import org.jboss.portal.uiserver.ajax.client.Page;
+import org.jboss.portal.uiserver.ajax.client.Window;
+import org.jboss.portal.uiserver.processor.ProcessorResponse;
+import org.jboss.portal.uiserver.service.EntryPoint;
+
+import com.google.gwt.user.client.rpc.SerializationException;
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
+/**
+ * This serves as the Portal Entry Point for AJAX (Asynchronous) RPC calls being made by the
+ * Ajax client of the Portal
+ * 
+ * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
+ * 
+ */
+public class PortalRPCImpl extends RemoteServiceServlet implements 
+PortalRPC
+{
+   /** The logger. */
+   private Logger log = Logger.getLogger(getClass());
+
+   /**
+    * 
+    */
+   private EntryPoint entryPoint = null;
+
+   /** Configure the as default servlet. */
+   public void init() throws ServletException
+   {
+      try
+      {
+         MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+         this.entryPoint = (EntryPoint) MBeanProxy.get(EntryPoint.class, new ObjectName(
+               this.getInitParameter("entryPointServiceName")),
+               mbeanServer);
+      }
+      catch (Exception e)
+      {
+         this.entryPoint = null;
+         String msg = "Portal Entry Point could not be created";
+         log.error(msg, e);
+         throw new UnavailableException(msg);
+      }
+   }
+   
+   /**
+    * 
+    */
+   public String processCall(String payload) throws SerializationException
+   {
+      HttpServletRequest request = this.getThreadLocalRequest();
+            
+      //Perform the remote procedure call
+      String returnVal =  super.processCall(payload);
+      
+      //Perform any post-processing after calling the actual remote method that will perform
+      //the functionality for this particular remote procedure call
+      if(request.getAttribute("processorResponse") != null)
+      {
+         ProcessorResponse processorResponse = (ProcessorResponse)request.getAttribute("processorResponse");
+         request.getSession().setAttribute("processorResponse", processorResponse);
+      }
+      
+      return returnVal;
+   }
+   // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+   /**
+    * Loads the initial Portal Page at the start of a Portal session
+    * 
+    * @return The Initial Portal Page
+    */
+   public Page loadPortal()
+   {
+      try
+      {
+         Page display = null;
+         HttpServletRequest request = this.getThreadLocalRequest();
+         this.callPortalServer();
+         display = this.getDisplay((ProcessorResponse)request.getAttribute("processorResponse"));
+         return display;
+      }
+      catch(Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   /**
+    * @return The Page of the Portal that should be currently displayed
+    */
+   public Page getCurrentPage()
+   {
+      Page currentPage = null;
+
+      HttpServletRequest request = this.getThreadLocalRequest();
+
+      ProcessorResponse processorResponse = (ProcessorResponse) request.getSession().getAttribute("processorResponse");
+      
+      currentPage = this.getDisplay(processorResponse);
+
+      return currentPage;
+   } 
+   
+   /**
+    * 
+    * @param processorResponse
+    * @return
+    */
+   private Page getDisplay(ProcessorResponse processorResponse)
+   {
+      Page display = null;
+      
+      org.jboss.portal.uiserver.protocol.Page portalPage = processorResponse
+      .findDisplayedPage();
+
+      // Construct the ajax currentPage object from the portalPage that has been
+      // chosen to be displayed
+      if (portalPage != null)
+      {
+         display = new Page();
+         display.setName(portalPage.getName());
+         List pageWindows = portalPage.getWindows();
+         if(pageWindows != null && pageWindows.size()>0)
+         {
+            Window[] windows = new Window[pageWindows.size()];
+            display.setWindows(windows);
+            for(int i=0; i<pageWindows.size(); i++)
+            {
+               org.jboss.portal.uiserver.protocol.Window pageWindow = (org.jboss.portal.uiserver.protocol.Window)pageWindows.get(i);
+               Window window = new Window();
+               window.setName(pageWindow.getName());
+               window.setContent(pageWindow.getContent());
+               windows[i] = window;               
+            }
+         }
+      }
+      
+      return display;
+   }
+   
+   /**
+    * 
+    *
+    */
+   private void callPortalServer() throws Exception
+   {
+      HttpServletRequest req = this.getThreadLocalRequest();
+      HttpServletResponse resp = this.getThreadLocalResponse();
+      String requestURI = req.getRequestURI();
+      String contextPath = req.getContextPath();
+      String portalHost = req.getServerName();
+      String portalRequestPath = requestURI.substring(contextPath.length());
+      String portalContextPath = requestURI.substring(0, contextPath.length());
+      Map queryParameterMap = new HashMap();
+      URLContext urlContext = URLContext.newInstance(req.isSecure(), req.getRemoteUser() != null);
+
+      Server server = this.entryPoint.getPortalServer();
+
+      //
+      ServerInvocationContext invocationCtx = new ServerInvocationContextImpl(
+         req,
+         resp,
+         portalHost,
+         portalRequestPath,
+         portalContextPath,
+         queryParameterMap,
+         null, //body parameter map is not applicable for asynchronous RPC calls
+         urlContext,
+         null //media type information is not applicable for asynchronous RPC calls
+         );
+      
+      //
+      ServerRequest request = new ServerRequest(invocationCtx);
+      request.setServer(server);
+
+      //
+      ServerResponse response = new ServerResponse(request, invocationCtx);
+
+      //
+      ServerInvocation invocation = new ServerInvocation(invocationCtx);
+      invocation.setRequest(request);
+      invocation.setResponse(response);
+
+      //
+      RequestControllerFactory controllerFactory = this.entryPoint.getControllerFactory();
+      RequestController controller = controllerFactory.createRequestController(invocation);
+      invocation.setHandler(new RequestControllerDispatcher(controller));
+      
+      InterceptorStackFactory stack = this.entryPoint.getInterceptorStackFactory();      
+      invocation.invoke(stack.getInterceptorStack());
+   }
+}

Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortletServiceImpl.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortletServiceImpl.java	                        (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/PortletServiceImpl.java	2007-11-06 07:18:27 UTC (rev 8829)
@@ -0,0 +1,233 @@
+package org.jboss.portal.uiserver.service.ajax;
+
+import java.io.InputStream;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.jboss.portal.uiserver.ajax.client.PortletService;
+import org.jboss.portal.uiserver.ajax.client.Page;
+import org.jboss.portal.uiserver.ajax.client.Window;
+
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
+/**
+ * This is just a STUB server side component to test the client side components
+ * of the GWT-based AJAX UI
+ * 
+ * In real implementation this functionality will be provided by the UIServer
+ * interfacing with the Portal Core
+ * 
+ * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
+ * 
+ */
+public class PortletServiceImpl extends RemoteServiceServlet implements
+      PortletService
+{
+   /**
+    * 
+    */
+   public String getPortlet(String portletId)
+   {
+      String portletContent = null;
+
+      String contentPath = portletId;
+      InputStream is = null;
+      try
+      {
+         is = Thread.currentThread().getContextClassLoader()
+               .getResourceAsStream(contentPath);
+         StringBuffer contentBuffer = new StringBuffer();
+         int bytesRead = 0;
+         byte[] data = new byte[1024];
+         while ((bytesRead = is.read(data)) != -1)
+         {
+            byte[] cour = new byte[bytesRead];
+            System.arraycopy(data, 0, cour, 0, bytesRead);
+            contentBuffer.append(new String(cour));
+         }
+         portletContent = contentBuffer.toString();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+      finally
+      {
+         if (is != null)
+         {
+            try
+            {
+               is.close();
+            }
+            catch (Exception e)
+            {
+            }
+         }
+      }
+
+      return portletContent;
+   }
+
+   /**
+    * 
+    * @param pageId
+    * @return
+    */
+   public Page getPage(String pageId)
+   {
+      Page page = new Page();
+      page.setName(pageId);
+
+      if (pageId.equals("index") || pageId.equals("Page 1"))
+      {
+         String weatherContent = this.getPortlet("weatherPortlet.html");
+         String cmsContent = this.getPortlet("cmsPortlet.html");
+         Window[] windows = new Window[2];
+         page.setWindows(windows);
+
+         Window weatherWindow = new Window();
+         weatherWindow.setName("weatherPortlet");
+         weatherWindow.setContent(weatherContent);
+
+         Window cmsWindow = new Window();
+         cmsWindow.setName("cmsPortlet");
+         cmsWindow.setContent(cmsContent);
+
+         windows[0] = weatherWindow;
+         windows[1] = cmsWindow;
+      }
+      else if (pageId.equals("Page 2"))
+      {
+         String weatherContent = this.getPortlet("weatherPortlet.html");
+         Window[] windows = new Window[1];
+         page.setWindows(windows);
+
+         Window weatherWindow = new Window();
+         weatherWindow.setName("weatherPortlet");
+         weatherWindow.setContent(weatherContent);
+
+         windows[0] = weatherWindow;
+      }
+      else if (pageId.equals("Page 3"))
+      {
+         String cmsContent = this.getPortlet("cmsPortlet.html");
+         Window[] windows = new Window[1];
+         page.setWindows(windows);
+
+         Window cmsWindow = new Window();
+         cmsWindow.setName("cmsPortlet");
+         cmsWindow.setContent(cmsContent);
+
+         windows[0] = cmsWindow;
+      }
+
+      HttpServletRequest request = this.getThreadLocalRequest();
+      request.getSession().setAttribute("currentPage", page);
+
+      return page;
+   }
+
+   /**
+    * 
+    * @param window
+    * @param state
+    */
+   public Page setState(String window, String newState)
+   {
+      HttpServletRequest request = this.getThreadLocalRequest();
+      Page page = (Page) request.getSession().getAttribute("currentPage");
+
+      Window selectedWindow = this.findWindow(page, window);
+      selectedWindow.setState(newState);
+      if (selectedWindow.getState().equals(Window.NORMAL))
+      {
+         if (selectedWindow.getName().equals("cmsPortlet"))
+         {
+            selectedWindow.setContent(this.getPortlet("cmsPortlet.html"));
+         }
+         else
+         {
+            selectedWindow.setContent(this.getPortlet("weatherPortlet.html"));
+         }
+         this.hideWindows(page.getWindows(), null, false);
+      }
+      else if (selectedWindow.getState().equals(Window.MINIMIZED))
+      {
+         selectedWindow.setContent("");
+         this.hideWindows(page.getWindows(), null, false);
+      }
+      if (selectedWindow.getState().equals(Window.MAXIMIZED))
+      {
+         if (selectedWindow.getName().equals("cmsPortlet"))
+         {
+            selectedWindow.setContent(this.getPortlet("cmsPortlet.html"));
+         }
+         else
+         {
+            selectedWindow.setContent(this.getPortlet("weatherPortlet.html"));
+         }
+         this.hideWindows(page.getWindows(), selectedWindow, true);
+      }
+
+      return page;
+   }
+
+   /**
+    * 
+    * @param window
+    * @param state
+    */
+   public Page setMode(String window, String newMode)
+   {
+      HttpServletRequest request = this.getThreadLocalRequest();
+      Page page = (Page) request.getSession().getAttribute("currentPage");
+
+      Window selectedWindow = this.findWindow(page, window);
+      selectedWindow.setMode(newMode);
+
+      return page;
+   }
+
+   /**
+    * 
+    * @param page
+    * @param windowName
+    * @return
+    */
+   private Window findWindow(Page page, String windowName)
+   {
+      Window window = null;
+
+      Window[] windows = page.getWindows();
+      for (int i = 0; i < windows.length; i++)
+      {
+         if (windows[i].getName().equals(windowName))
+         {
+            window = windows[i];
+            break;
+         }
+      }
+
+      return window;
+   }
+
+   /**
+    * 
+    * @param excludedWindow
+    * @param hide
+    */
+   private void hideWindows(Window[] windows, Window excludedWindow,
+         boolean hide)
+   {
+      for (int i = 0; i < windows.length; i++)
+      {
+         if (excludedWindow != null
+               && windows[i].getName().equals(excludedWindow.getName()))
+         {
+            continue;
+         }
+
+         windows[i].setVisible(!hide);
+      }
+   }
+}

Modified: branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/AsyncPages.gwt.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/AsyncPages.gwt.xml	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/AsyncPages.gwt.xml	2007-11-06 07:18:27 UTC (rev 8829)
@@ -6,5 +6,5 @@
 	<entry-point class="org.jboss.portal.uiserver.ajax.client.AsyncPages"/>  
 	
 	<!-- RPC related configuration -->
-	<servlet path="/portletService" class="org.jboss.portal.uiserver.service.PortletServiceImpl"/>
+	<servlet path="/portletService" class="org.jboss.portal.uiserver.service.ajax.PortletServiceImpl"/>
 </module>

Modified: branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/PartialRefresh.gwt.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/PartialRefresh.gwt.xml	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/PartialRefresh.gwt.xml	2007-11-06 07:18:27 UTC (rev 8829)
@@ -6,5 +6,5 @@
 	<entry-point class="org.jboss.portal.uiserver.ajax.client.PartialRefresh"/>  
 	
 	<!-- RPC related configuration -->
-	<servlet path="/portletService" class="org.jboss.portal.uiserver.service.PortletServiceImpl"/>
+	<servlet path="/portletService" class="org.jboss.portal.uiserver.service.ajax.PortletServiceImpl"/>
 </module>

Modified: branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml	2007-11-06 07:18:27 UTC (rev 8829)
@@ -5,6 +5,6 @@
 	<!-- Specify the app entry point class -->
 	<entry-point class="org.jboss.portal.uiserver.ajax.client.Portal"/>  
 	
-	<!-- RPC related configuration -->
-	<servlet path="/portletService" class="org.jboss.portal.uiserver.service.PortletServiceImpl"/>
+	<!-- RPC related configuration. This is used only in Hosted Mode -->
+	<servlet path="/portalrpc" class="org.jboss.portal.uiserver.service.ajax.HostedModeProxy"/>
 </module>

Modified: branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/PortalLayout.gwt.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/PortalLayout.gwt.xml	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/PortalLayout.gwt.xml	2007-11-06 07:18:27 UTC (rev 8829)
@@ -6,5 +6,5 @@
 	<entry-point class="org.jboss.portal.uiserver.ajax.client.PortalLayout"/>  
 	
 	<!-- RPC related configuration -->
-	<servlet path="/portletService" class="org.jboss.portal.uiserver.service.PortletServiceImpl"/>
+	<servlet path="/portletService" class="org.jboss.portal.uiserver.service.ajax.PortletServiceImpl"/>
 </module>

Modified: branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/index.html
===================================================================
--- branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/index.html	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/index.html	2007-11-06 07:18:27 UTC (rev 8829)
@@ -30,13 +30,10 @@
 		
 		<!-- AJAX Client for Portal Proof of Concept -->
 		<p>
-			Asynchronous Page Management 
+			JBoss Portal
 		</p>			
-		<table align="center">
+		<table align="center">						
 			<tr>
-				<td id="pageNavigator"></td>
-			</tr>			
-			<tr>
 				<td id="currentPage"></td>
 			</tr>			
 		</table>										

Modified: branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml	2007-11-06 07:18:27 UTC (rev 8829)
@@ -42,4 +42,14 @@
       <depends>portal:service=ResponseHandler,type=Selector</depends>
       <depends>portal:service=ControlPolicy,type=Page</depends>
   </mbean>
+  <mbean
+      code="org.jboss.portal.uiserver.service.EntryPointImpl"
+      name="portal:service=EntryPoint"
+      xmbean-dd=""
+      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+      <xmbean/>
+      <depends optional-attribute-name="InterceptorStackFactory" proxy-type="attribute">portal:service=InterceptorStackFactory,type=Server</depends>
+      <depends optional-attribute-name="ControllerFactory" proxy-type="attribute">portal:service=ControllerFactory</depends>      
+      <depends optional-attribute-name="PortalServer" proxy-type="attribute">portal:service=Server</depends>      
+  </mbean>
 </server>

Modified: branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/web.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/web.xml	2007-11-05 18:18:18 UTC (rev 8828)
+++ branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/web.xml	2007-11-06 07:18:27 UTC (rev 8829)
@@ -35,8 +35,8 @@
    		<filter-name>GWTClientFilter</filter-name>
    		<servlet-name>PortalEntryPoint</servlet-name>
    </filter-mapping>
-   
 
+
    <!-- The portal servlet is the main entrance point -->
    <servlet>
       <servlet-name>PortalEntryPoint</servlet-name>
@@ -47,64 +47,48 @@
          <description>The servlet needs to know wether it is set as a default servlet or not</description>
       </init-param>
       <init-param>
-         <param-name>controllerFactoryName</param-name>
-         <param-value>portal:service=ControllerFactory</param-value>
-         <description>The request controller factory for the portal servlet</description>
+         <param-name>entryPointServiceName</param-name>
+         <param-value>portal:service=EntryPoint</param-value>
+         <description>Entry Point Service</description>
       </init-param>
-      <load-on-startup>0</load-on-startup>
-      <security-role-ref>
-        <role-name>Authenticated</role-name>
-        <role-link>Authenticated</role-link>
-      </security-role-ref>
-   </servlet>
-   
+      <load-on-startup>0</load-on-startup>      
+   </servlet>   
    <servlet-mapping>
       <servlet-name>PortalEntryPoint</servlet-name>
       <url-pattern>/*</url-pattern>
    </servlet-mapping>
-
    <servlet-mapping>
       <servlet-name>PortalEntryPoint</servlet-name>
       <url-pattern>/sec/*</url-pattern>
    </servlet-mapping>
-
    <servlet-mapping>
       <servlet-name>PortalEntryPoint</servlet-name>
       <url-pattern>/auth/*</url-pattern>
    </servlet-mapping>
-
    <servlet-mapping>
       <servlet-name>PortalEntryPoint</servlet-name>
       <url-pattern>/authsec/*</url-pattern>
    </servlet-mapping>
-            
-   <!-- GWT Prototyping only -->
+   
+      
+   <!-- Asynchronous service request processor -->
    <servlet>
-      <servlet-name>PortletService</servlet-name>
-      <servlet-class>org.jboss.portal.uiserver.service.PortletServiceImpl</servlet-class>
+      <servlet-name>PortalRPC</servlet-name>
+      <servlet-class>org.jboss.portal.uiserver.service.ajax.PortalRPCImpl</servlet-class>
+      <init-param>
+         <param-name>asDefaultServlet</param-name>
+         <param-value>false</param-value>
+         <description>The servlet needs to know wether it is set as a default servlet or not</description>
+      </init-param>
+      <init-param>
+         <param-name>entryPointServiceName</param-name>
+         <param-value>portal:service=EntryPoint</param-value>
+         <description>Entry Point Service</description>
+      </init-param>
       <load-on-startup>0</load-on-startup>
-   </servlet>
-      
+   </servlet>      
    <servlet-mapping>
-      <servlet-name>PortletService</servlet-name>
-      <url-pattern>/portletService/*</url-pattern>
-   </servlet-mapping>
-   
-   <!-- these are only for standalone prototype testing...this is not integrated with portal -->
-   <!--
-   <servlet-mapping>
-      <servlet-name>PortletService</servlet-name>
-      <url-pattern>/org.jboss.portal.uiserver.ajax.PortalLayout/portletService/*</url-pattern>
-   </servlet-mapping> 
-    
-   <servlet-mapping>
-      <servlet-name>PortletService</servlet-name>
-      <url-pattern>/org.jboss.portal.uiserver.ajax.PartialRefresh/portletService/*</url-pattern>
-   </servlet-mapping>
-   
-   <servlet-mapping>
-      <servlet-name>PortletService</servlet-name>
-      <url-pattern>/org.jboss.portal.uiserver.ajax.AsyncPages/portletService/*</url-pattern>
-   </servlet-mapping>
-   -->
+      <servlet-name>PortalRPC</servlet-name>
+      <url-pattern>/portalrpc/*</url-pattern>
+   </servlet-mapping>      
 </web-app>




More information about the portal-commits mailing list