Author: sohil.shah(a)jboss.com
Date: 2007-10-18 02:17:01 -0400 (Thu, 18 Oct 2007)
New Revision: 8686
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Portal.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/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/public/index.html
branches/UIServer/uiserver/src/resources/portal-uiserver.sar/
branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/
branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml
branches/UIServer/uiserver/src/resources/portal-uiserver.war/
branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/
branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/jboss-web.xml
branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/web.xml
branches/UIServer/uiserver/src/resources/portal-uiserver.war/asyncPages.html
branches/UIServer/uiserver/src/resources/portal-uiserver.war/layout.html
branches/UIServer/uiserver/src/resources/portal-uiserver.war/partialRefresh.html
Removed:
branches/UIServer/uiserver/src/resources/client/ajax/uiserver-poc.war/
Modified:
branches/UIServer/core/build.xml
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
branches/UIServer/uiserver/build.xml
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortletServiceImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
Log:
First pass of integrating a GWT-based AJAX client with PF (PF=Presentation Framework).
Code still raw. Mainly trying to backup code before leaving town.
Modified: branches/UIServer/core/build.xml
===================================================================
--- branches/UIServer/core/build.xml 2007-10-17 16:48:30 UTC (rev 8685)
+++ branches/UIServer/core/build.xml 2007-10-18 06:17:01 UTC (rev 8686)
@@ -348,7 +348,7 @@
<!--dtd-->
<copy todir="${build.resources}/jboss-portal/dtd">
<fileset dir="${jboss.portal-identity.root}/resources/dtd"
includes="*.dtd"/>
- </copy>
+ </copy>
</target>
@@ -380,19 +380,16 @@
</target>
<!-- Build the jboss-portal.sar -->
- <target name="pre-output">
- <copy todir="${build.resources}/jboss-portal/lib">
- <fileset dir="${jboss.portal-uiserver.root}/lib"
includes="portal-uiserver-lib.jar"/>
- </copy>
- <copy todir="${build.resources}/jboss-portal.sar/lib">
- <fileset dir="${jboss.portal-uiserver.root}/lib"
includes="portal-uiserver-lib.jar"/>
- </copy>
- <copy todir="${build.resources}/jboss-portal/lib">
- <fileset dir="${jboss.portal-core-uiserver.root}/lib"
includes="portal-core-uiserver-lib.jar"/>
- </copy>
- <copy todir="${build.resources}/jboss-portal.sar/lib">
- <fileset dir="${jboss.portal-core-uiserver.root}/lib"
includes="portal-core-uiserver-lib.jar"/>
- </copy>
+ <target name="pre-output">
+ <copy todir="${build.resources}/jboss-portal/lib">
+ <fileset dir="${jboss.portal-core-uiserver.root}/lib"
includes="portal-core-uiserver-lib.jar"/>
+ </copy>
+ <copy todir="${build.resources}/jboss-portal.sar/lib">
+ <fileset dir="${jboss.portal-core-uiserver.root}/lib"
includes="portal-core-uiserver-lib.jar"/>
+ </copy>
+ <copy todir="${build.resources}/jboss-portal/portal-uiserver.sar">
+ <fileset
dir="${jboss.portal-uiserver.root}/resources/portal-uiserver.sar"/>
+ </copy>
</target>
<target name="output" depends="artifacts,pre-output">
<!-- Build configurations -->
@@ -745,6 +742,7 @@
-->
<target name="deploy-explode" depends="output,explode">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete
dir="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar"/>
<copy todir="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar"
overwrite="true">
<fileset dir="${build.lib}/jboss-portal-exploded.sar"/>
</copy>
Modified: branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
---
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-10-17
16:48:30 UTC (rev 8685)
+++
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-10-18
06:17:01 UTC (rev 8686)
@@ -1128,26 +1128,7 @@
<depends>portal:service=ContentProviderRegistry</depends>
<depends>portal:service=ResponseHandler,type=Selector</depends>
<depends>portal:service=ControlPolicy,type=Page</depends>
- </mbean>
- <mbean
- code="org.jboss.portal.uiserver.service.UIServer"
- name="portal:service=Controller"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortalObjectReader"
proxy-type="attribute">portal:container=PortalObjectReader</depends>
- <depends optional-attribute-name="Processor"
proxy-type="attribute">portal:service=Processor</depends>
- <depends>portal:service=PageService</depends>
- <depends>portal:commandFactory=DefaultPortal</depends>
- <depends>portal:urlFactory=Delegating</depends>
- <depends>portal:service=InterceptorStackFactory,type=Command</depends>
- <depends>portal:container=Instance</depends>
- <depends>portal:service=PortalAuthorizationManagerFactory</depends>
- <depends>portal:service=CustomizationManager</depends>
- <depends>portal:service=ContentProviderRegistry</depends>
- <depends>portal:service=ResponseHandler,type=Selector</depends>
- <depends>portal:service=ControlPolicy,type=Page</depends>
- </mbean>
+ </mbean>
<!-- The controller factory -->
Modified: branches/UIServer/uiserver/build.xml
===================================================================
--- branches/UIServer/uiserver/build.xml 2007-10-17 16:48:30 UTC (rev 8685)
+++ branches/UIServer/uiserver/build.xml 2007-10-18 06:17:01 UTC (rev 8686)
@@ -210,7 +210,60 @@
</fileset>
<fileset dir="../portlet/output/classes">
</fileset>
- </jar>
+ </jar>
+
+ <!-- portal-uiserver.war -->
+ <!-- compile the GWT Java code into JavaScript/Web resources -->
+ <!--
+ These are only standalone GWT prototypes
+ <delete
dir="${build.resources}/portal-uiserver.war/org.jboss.portal.uiserver.ajax.PortalLayout"/>
+ <java classpathref="gwt.gwt.classpath" fork="true"
classname="com.google.gwt.dev.GWTCompiler">
+ <classpath>
+ <pathelement path="src/main"/>
+ <pathelement path="src/resources/client/ajax/src"/>
+ </classpath>
+ <arg line="-out ${build.resources}/portal-uiserver.war/"/>
+ <arg line="org.jboss.portal.uiserver.ajax.PortalLayout"/>
+ </java>
+
+ <delete
dir="${build.resources}/portal-uiserver.war/org.jboss.portal.uiserver.ajax.PartialRefresh"/>
+ <java classpathref="gwt.gwt.classpath" fork="true"
classname="com.google.gwt.dev.GWTCompiler">
+ <classpath>
+ <pathelement path="src/main"/>
+ <pathelement path="src/resources/client/ajax/src"/>
+ </classpath>
+ <arg line="-out ${build.resources}/portal-uiserver.war/"/>
+ <arg line="org.jboss.portal.uiserver.ajax.PartialRefresh"/>
+ </java>
+ -->
+
+ <delete
dir="${build.resources}/portal-uiserver.war/org.jboss.portal.uiserver.ajax.Portal"/>
+ <java classpathref="gwt.gwt.classpath" fork="true"
classname="com.google.gwt.dev.GWTCompiler">
+ <classpath>
+ <pathelement path="src/main"/>
+ <pathelement path="src/resources/client/ajax/src"/>
+ </classpath>
+ <arg line="-out ${build.resources}/portal-uiserver.war/"/>
+ <arg line="org.jboss.portal.uiserver.ajax.Portal"/>
+ </java>
+ <jar jarfile="${build.lib}/portal-uiserver.war">
+ <fileset
dir="${build.resources}/portal-uiserver.war"></fileset>
+ </jar>
+ <copy todir="${build.resources}/portal-uiserver.war">
+ <fileset
dir="${build.resources}/portal-uiserver.war/org.jboss.portal.uiserver.ajax.Portal"/>
+ </copy>
+ <delete
dir="${build.resources}/portal-uiserver.war/org.jboss.portal.uiserver.ajax.Portal"/>
+
+
+ <!-- portal-uiserver.sar -->
+ <copy file="${gwt.gwt.root}/lib/gwt-user.jar"
todir="${build.resources}/portal-uiserver.sar/lib"
overwrite="true"/>
+ <copy file="${build.lib}/portal-uiserver-lib.jar"
todir="${build.resources}/portal-uiserver.sar/lib"
overwrite="true"/>
+ <copy
todir="${build.resources}/portal-uiserver.sar/portal-uiserver.war">
+ <fileset dir="${build.resources}/portal-uiserver.war"/>
+ </copy>
+ <jar jarfile="${build.lib}/portal-uiserver.sar">
+ <fileset
dir="${build.resources}/portal-uiserver.sar"></fileset>
+ </jar>
</target>
<target name="output" depends="artifacts">
@@ -246,47 +299,5 @@
<!-- ================================================================== -->
<!-- Deployment -->
- <!-- ================================================================== -->
- <target name="deploy-poc" depends="output">
- <!-- compile the GWT Java code into JavaScript/Web resources -->
- <delete
dir="${build.resources}/client/ajax/uiserver-poc.war/org.jboss.portal.uiserver.ajax.PortalLayout"/>
- <java classpathref="gwt.gwt.classpath" fork="true"
classname="com.google.gwt.dev.GWTCompiler">
- <classpath>
- <pathelement path="src/main"/>
- <pathelement path="src/resources/client/ajax/src"/>
- </classpath>
- <arg line="-out ${build.resources}/client/ajax/uiserver-poc.war/"/>
- <arg line="org.jboss.portal.uiserver.ajax.PortalLayout"/>
- </java>
-
- <delete
dir="${build.resources}/client/ajax/uiserver-poc.war/org.jboss.portal.uiserver.ajax.PartialRefresh"/>
- <java classpathref="gwt.gwt.classpath" fork="true"
classname="com.google.gwt.dev.GWTCompiler">
- <classpath>
- <pathelement path="src/main"/>
- <pathelement path="src/resources/client/ajax/src"/>
- </classpath>
- <arg line="-out ${build.resources}/client/ajax/uiserver-poc.war/"/>
- <arg line="org.jboss.portal.uiserver.ajax.PartialRefresh"/>
- </java>
-
- <delete
dir="${build.resources}/client/ajax/uiserver-poc.war/org.jboss.portal.uiserver.ajax.AsyncPages"/>
- <java classpathref="gwt.gwt.classpath" fork="true"
classname="com.google.gwt.dev.GWTCompiler">
- <classpath>
- <pathelement path="src/main"/>
- <pathelement path="src/resources/client/ajax/src"/>
- </classpath>
- <arg line="-out ${build.resources}/client/ajax/uiserver-poc.war/"/>
- <arg line="org.jboss.portal.uiserver.ajax.AsyncPages"/>
- </java>
-
- <copy file="${build.lib}/portal-uiserver-lib.jar"
todir="${build.resources}/client/ajax/uiserver-poc.war/WEB-INF/lib"
overwrite="true"/>
- <copy
file="src/resources/client/ajax/uiserver-poc.war/WEB-INF/lib/gwt-user.jar"
todir="${build.resources}/client/ajax/uiserver-poc.war/WEB-INF/lib"
overwrite="true"/>
-
- <jar jarfile="${build.lib}/uiserver-poc.war">
- <fileset
dir="${build.resources}/client/ajax/uiserver-poc.war"></fileset>
- </jar>
-
- <!-- deploy the poc war file into the application server for testing -->
- <copy file="${build.lib}/uiserver-poc.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
- </target>
+ <!-- ================================================================== -->
</project>
Added:
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
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Portal.java 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,429 @@
+package org.jboss.portal.uiserver.ajax.client;
+
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.EntryPoint;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.HTTPRequest;
+import com.google.gwt.user.client.ResponseTextHandler;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+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;
+
+/**
+ * Entry point classes define <code>onModuleLoad()</code>.
+ */
+public class Portal implements EntryPoint
+{
+ /**
+ * This is the entry point method.
+ */
+ public void onModuleLoad()
+ {
+ this.loadPortal();
+ }
+
+ /**
+ *
+ *
+ */
+ 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");
+
+ AsyncCallback callback = new AsyncCallback()
+ {
+ public void onSuccess(Object result)
+ {
+ Page portalPage = (Page)result;
+ displayPortalPage(portalPage);
+ }
+
+ public void onFailure(Throwable caught)
+ {
+ }
+ };
+
+ portletService.getPage(pageId, callback);
+ }
+
+ /**
+ *
+ * @param window
+ * @param newState
+ */
+ private void handleWindowStateChanged(String window, String newState)
+ {
+ PortletServiceAsync portletService =
(PortletServiceAsync)GWT.create(PortletService.class);
+
((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portletService");
+
+ AsyncCallback callback = new AsyncCallback()
+ {
+ public void onSuccess(Object result)
+ {
+ Page portalPage = (Page)result;
+ displayPortalPage(portalPage);
+ }
+
+ public void onFailure(Throwable caught)
+ {
+ }
+ };
+
+ portletService.setState(window, newState, callback);
+ }
+
+ /**
+ *
+ * @param window
+ * @param newState
+ */
+ private void handleWindowModeChanged(String window, String newMode)
+ {
+ PortletServiceAsync portletService =
(PortletServiceAsync)GWT.create(PortletService.class);
+
((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portletService");
+
+ AsyncCallback callback = new AsyncCallback()
+ {
+ public void onSuccess(Object result)
+ {
+ Page portalPage = (Page)result;
+ displayPortalPage(portalPage);
+ }
+
+ public void onFailure(Throwable caught)
+ {
+ }
+ };
+
+ portletService.setMode(window, newMode, callback);
+ }
+
+ /**
+ *
+ * @param url
+ * @param portletWindow
+ */
+ 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)
+ {
+ if(method.equalsIgnoreCase("post"))
+ {
+ HTTPRequest.asyncPost(url, postData, new
ResponseTextHandlerImpl(windowContent));
+ }
+ else if(method.equalsIgnoreCase("get"))
+ {
+ if(postData != null && postData.trim().length() > 0)
+ {
+ url = url + "?" + postData;
+ }
+ HTTPRequest.asyncGet(url, new ResponseTextHandlerImpl(windowContent));
+ }
+ }
+
+ /**
+ *
+ * @author soshah
+ *
+ */
+ private class ResponseTextHandlerImpl implements ResponseTextHandler
+ {
+ private Widget windowContent = null;
+
+ public ResponseTextHandlerImpl(Widget windowContent)
+ {
+ this.windowContent = windowContent;
+ }
+ public void onCompletion(String responseText)
+ {
+ HTML html = new HTML(responseText);
+ Panel window = (Panel)this.windowContent.getParent();
+ this.windowContent.removeFromParent();
+ window.add(html);
+ }
+ }
+
+ /**
+ *
+ * @param url
+ * @return
+ */
+ 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
+ //If Portal is installed at Root context, this value will be an empty string
+
+ if(url.startsWith(basePortalURL))
+ {
+ //This is an Absolute URL, but it points back to
+ //the Portal
+ //An Async Page Refresh call should be allowed in this case
+ return true;
+ }
+
+ if(url.startsWith("http://"))
+ {
+ //This is an Absolute URL and does not point back
+ //to the Portal
+ //Async Page Refresh call should not be allowed
+ return false;
+ }
+ else
+ {
+ //This is a relative URL.
+
+ //Make sure it points back to the Portal for an Async Page Refresh
+ //If it points to some other resource like another third-party web application
etc, the response
+ //has nothing to do with Portal
+ //(unless ofcourse the client side processor of the Portal, wants to
+ //take this response and aggregate this inside the current Portal Page and
Window being displayed. This is an exceptional usecase
+ //and not desired behavior for every scenario from end user standpoint)
+ //As standard behavior, Async Page Refresh to be done, only when Portlet Markup
is sending a request back to the Portal
+ if(url.startsWith("/"))
+ {
+ if(!portalContext.equals(""))
+ {
+ String urlContext = null;
+ int index = url.indexOf('/', 1);
+ if(index != -1)
+ {
+ urlContext = url.substring(1, index);
+ }
+ else
+ {
+ urlContext = url.substring(1);
+ }
+
+ if(!portalContext.equals(urlContext))
+ {
+ //This request is not being sent to the Portal. It is being sent to
some other web application
+ return false;
+ }
+ }
+ else
+ {
+ //If Portal is running on root context, there is no way to tell from
client side, if this request is actually
+ //to be sent to the Portal or some other web application. Hence, in the
interest of functional safety/correctness
+ //no Async Page Refresh here
+ //If Portal is running on Root context, Partial Refresh will happen only
for pure relative links
+ return false;
+ }
+ }
+
+ //If I get here, Async Page Refresh through the Portal should be allowed
+ return true;
+ }
+ }
+
+ /**
+ *
+ * @param currentForm
+ * @return
+ */
+ public native String serializeForm(Element currentForm)
+ /*-{
+ 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");
+ }
+ }
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/GWTClientFilter.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/GWTClientFilter.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/GWTClientFilter.java 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,142 @@
+/******************************************************************************
+ * 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 java.io.IOException;
+import java.io.InputStream;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class GWTClientFilter implements Filter
+{
+ /**
+ *
+ */
+ public void destroy()
+ {
+ }
+
+ /**
+ *
+ */
+ public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
FilterChain filterChain) throws IOException, ServletException
+ {
+ HttpServletRequest request = (HttpServletRequest)servletRequest;
+ HttpServletResponse response = (HttpServletResponse)servletResponse;
+ String contextPath = request.getContextPath();
+ String resource = request.getRequestURI().replaceFirst(contextPath, "");
+ while(resource.startsWith("/"))
+ {
+ if(resource.length() > 1)
+ {
+ resource = resource.substring(1);
+ }
+ else
+ {
+ resource = "";
+ }
+ }
+
+ if(resource == null || resource.trim().length() == 0)
+ {
+ response.sendRedirect("index.html");
+ return;
+ }
+
+ //Now make sure the resource requested is a GWT resource
+ if( resource.equals("index.html") ||
+ resource.equals("portal.css") ||
+ resource.equals("gwt.js") ||
+ resource.equals("prototype.js") ||
+ resource.contains(".cache.") ||
+ resource.contains(".nocache.") ||
+ resource.contains(".gwt.rpc")
+ )
+ {
+ String gwtResource = this.readContent(resource);
+ response.getOutputStream().write(gwtResource.getBytes());
+ response.getOutputStream().flush();
+ return;
+ }
+
+ //Propagate the request further
+ filterChain.doFilter(servletRequest, servletResponse);
+ }
+
+ /**
+ *
+ */
+ public void init(FilterConfig arg0) throws ServletException
+ {
+ }
+
+ /**
+ *
+ * @param path
+ * @return
+ */
+ private String readContent(String path)
+ {
+ String content = null;
+
+ InputStream is = null;
+ try
+ {
+ is = Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
+ 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));
+ }
+ content = contentBuffer.toString();
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ if(is != null)
+ {
+ try{is.close();}catch(Exception e){}
+ }
+ }
+
+ return content;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortalEntryPoint.java 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,452 @@
+/******************************************************************************
+ * 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 java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+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.http.QueryStringParser;
+import org.jboss.portal.common.invocation.InterceptorStackFactory;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.net.URLTools;
+import org.jboss.portal.common.util.Exceptions;
+import org.jboss.portal.server.PortalConstants;
+import org.jboss.portal.server.RequestController;
+import org.jboss.portal.server.RequestControllerDispatcher;
+import org.jboss.portal.server.RequestControllerFactory;
+import org.jboss.portal.server.Server;
+import org.jboss.portal.server.ServerException;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portal.server.ServerRequest;
+import org.jboss.portal.server.ServerResponse;
+import org.jboss.portal.server.impl.ServerInvocationContextImpl;
+import org.jboss.portal.server.request.URLContext;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PortalEntryPoint extends HttpServlet
+{
+ /** . */
+ private static final int GET_METHOD = 0;
+
+ /** . */
+ private static final int POST_METHOD = 1;
+
+ /** Describes a default servlet mapping. */
+ private static final int DEFAULT_SERVLET_MAPPING = 0;
+
+ /** Describes a root path mapping. */
+ private static final int ROOT_PATH_MAPPING = 1;
+
+ /** 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;
+
+ /** Configure the as default servlet. */
+ public void init() throws ServletException
+ {
+ asDefaultServlet = getAsDefaultServletInitValue();
+ controllerFactoryName =
getServletConfig().getInitParameter("controllerFactoryName");
+ }
+
+ /**
+ *
+ */
+ protected final Server getServer()
+ {
+ if (server == null)
+ {
+ 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);
+ }
+ }
+ return server;
+ }
+
+ protected final InterceptorStackFactory getInterceptorStackFactory()
+ {
+ if (interceptorStack == null)
+ {
+ 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);
+ }
+ }
+ 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
+ {
+ //
+ String servletPath = req.getServletPath();
+ String requestURI = req.getRequestURI();
+ String contextPath = req.getContextPath();
+
+ String resource = req.getRequestURI().replaceFirst(contextPath, "");
+ while(resource.startsWith("/"))
+ {
+ if(resource.length() > 1)
+ {
+ resource = resource.substring(1);
+ }
+ else
+ {
+ resource = "";
+ }
+ }
+
+ if(resource == null || resource.trim().length() == 0)
+ {
+ resp.sendRedirect("index.html");
+ return;
+ }
+
+ int method;
+ if ("GET".equals(req.getMethod()))
+ {
+ method = GET_METHOD;
+ }
+ else if ("POST".equals(req.getMethod()))
+ {
+ method = POST_METHOD;
+ }
+ else
+ {
+ throw new ServletException();
+ }
+
+ // Compute the media type in the content type
+ String mediaType = 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))
+ {
+ // Now we must ensure that we have either an equals or a trailing space after
the media-type
+ String characterEncoding = req.getCharacterEncoding();
+ if (characterEncoding == null)
+ {
+ // Set out charset for the portal request
+ req.setCharacterEncoding(PortalConstants.UTF_8.name());
+ }
+ else
+ {
+ Charset charset = Charset.forName(characterEncoding);
+ if (!PortalConstants.UTF_8.equals(charset))
+ {
+ throw new ServletException("Unaccepted charset " +
characterEncoding);
+ }
+ }
+ }
+
+ // Determine the mapping we have
+ int mapping = DEFAULT_SERVLET_MAPPING;
+ if (!asDefaultServlet)
+ {
+ if (servletPath.length() == 0)
+ {
+ mapping = ROOT_PATH_MAPPING;
+ }
+ else
+ {
+ mapping = PATH_MAPPING;
+ }
+ }
+
+ // Determine the host for this request
+ String portalHost = req.getServerName();
+
+ // Determine the request path
+ String portalRequestPath = null;
+ String portalContextPath = null;
+ switch (mapping)
+ {
+ case DEFAULT_SERVLET_MAPPING:
+ portalRequestPath = requestURI.substring(contextPath.length());
+ portalContextPath = requestURI.substring(0, contextPath.length());
+ break;
+ case ROOT_PATH_MAPPING:
+ portalRequestPath = requestURI.substring(contextPath.length());
+ portalContextPath = requestURI.substring(0, contextPath.length());
+ break;
+ case PATH_MAPPING:
+ portalRequestPath = requestURI.substring(contextPath.length() +
servletPath.length());
+ portalContextPath = requestURI.substring(0, contextPath.length() +
servletPath.length());
+ break;
+ }
+
+ // Apply the url decoding
+ portalRequestPath = URLTools.decodeXWWWFormURL(portalRequestPath);
+ portalContextPath = URLTools.decodeXWWWFormURL(portalContextPath);
+
+ //
+ URLContext urlContext = URLContext.newInstance(req.isSecure(), req.getRemoteUser()
!= null);
+
+ // ***************
+ // ***************
+ // ***************
+ // ***************
+
+ // Parse the query string to have the get parameters
+ // The resulting map has its parameters decoded from the x-www-form-url encoding
+ Map queryParameterMap = Collections.EMPTY_MAP;
+ String queryString = req.getQueryString();
+ if (queryString != null)
+ {
+ queryParameterMap = QueryStringParser.parseQueryString(queryString);
+ }
+
+ //
+ Map bodyParameterMap = null;
+ if (method == POST_METHOD &&
PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED.equals(mediaType))
+ {
+ bodyParameterMap = Collections.EMPTY_MAP;
+ for (Iterator i = req.getParameterMap().entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+
+ // Get param name
+ String paramName = (String)entry.getKey();
+
+ // Values that are aggregated from the query string and the body
+ String[] paramValues = (String[])entry.getValue();
+
+ // Values decoded from the query string
+ String[] queryValues = (String[])queryParameterMap.get(paramName);
+ if (queryValues != null)
+ {
+ int bodyValuesLength = paramValues.length - queryValues.length;
+ if (bodyValuesLength > 0)
+ {
+ String[] bodyValues = new String[bodyValuesLength];
+ System.arraycopy(paramValues, queryValues.length, bodyValues, 0,
bodyValuesLength);
+ if (bodyParameterMap.isEmpty())
+ {
+ bodyParameterMap = new HashMap();
+ }
+ bodyParameterMap.put(paramName, bodyValues);
+ }
+ }
+ else
+ {
+ if (bodyParameterMap.isEmpty())
+ {
+ bodyParameterMap = new HashMap();
+ }
+ bodyParameterMap.put(paramName, paramValues);
+ }
+ }
+
+ // Make the map unmodifiable
+ bodyParameterMap = bodyParameterMap.isEmpty() ? bodyParameterMap :
Collections.unmodifiableMap(bodyParameterMap);
+ }
+
+ // ***************
+ // ***************
+ // ***************
+ // ***************
+
+ //
+ Server server = getServer();
+
+ //
+ ServerInvocationContext invocationCtx = new ServerInvocationContextImpl(
+ req,
+ resp,
+ portalHost,
+ portalRequestPath,
+ portalContextPath,
+ queryParameterMap,
+ bodyParameterMap,
+ urlContext,
+ mediaType);
+
+ //
+ 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 = getControllerFactory();
+ RequestController controller =
controllerFactory.createRequestController(invocation);
+ invocation.setHandler(new RequestControllerDispatcher(controller));
+
+ //
+ try
+ {
+ InterceptorStackFactory stack = getInterceptorStackFactory();
+ invocation.invoke(stack.getInterceptorStack());
+ }
+ catch (ServerException e)
+ {
+ log.error("Server exception", e);
+ Throwable nested = Exceptions.unwrap(e);
+ throw new ServletException(nested);
+ }
+ catch (InvocationException e)
+ {
+ log.error("Invocation exception", e);
+ Throwable nested = Exceptions.unwrap(e);
+ throw new ServletException(nested);
+ }
+ catch (ServletException e)
+ {
+ throw e;
+ }
+ catch (IOException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ log.error("Unexpected exception", e);
+ 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>
+ */
+ protected boolean getAsDefaultServletInitValue()
+ {
+ ServletConfig config = getServletConfig();
+ String value = config.getInitParameter("asDefaultServlet");
+ if ("true".equalsIgnoreCase(value))
+ {
+ log.debug("Servlet loaded as default servlet mapping");
+ return true;
+ }
+ else if ("false".equalsIgnoreCase(value))
+ {
+ log.debug("Servlet loaded as path mapping servlet");
+ return false;
+ }
+ else
+ {
+ log.warn("Servlet mapping cannot be determined with init parameter
value=" + value);
+ return false;
+ }
+ }
+}
Modified:
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-10-17
16:48:30 UTC (rev 8685)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/PortletServiceImpl.java 2007-10-18
06:17:01 UTC (rev 8686)
@@ -27,9 +27,8 @@
public String getPortlet(String portletId)
{
String portletContent = null;
- String basePath = "org.jboss.portal.uiserver.ajax.PortalLayout";
- String contentPath = basePath + "/" + portletId;
+ String contentPath = portletId;
InputStream is = null;
try
{
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-10-17
16:48:30 UTC (rev 8685)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java 2007-10-18
06:17:01 UTC (rev 8686)
@@ -27,11 +27,6 @@
import java.util.List;
import java.util.StringTokenizer;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanServerLocator;
-
import org.jboss.portal.uiserver.protocol.Container;
import org.jboss.portal.uiserver.protocol.Page;
import org.jboss.portal.uiserver.protocol.Window;
@@ -160,7 +155,7 @@
ProcessorRequest processorRequest = new ProcessorRequest(actionType, invocation,
portal, target);
ProcessorResponse processorResponse = this.processor.process(processorRequest);
-
+
//Go ahead and render to the client based on ProcessorResponse received from the
core Portal
if(processorResponse != null)
{
@@ -170,7 +165,7 @@
this.render(invocation.getServerContext().getClientResponse().getWriter(),
displayedPage);
}
- }
+ }
}
catch(Exception e)
{
@@ -234,18 +229,13 @@
*
* 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
- */
+ */
+ //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
- */
+ //Some region layout testing code
//Object[] regionData = this.getRegionBasedLayoutManager(pageResult);
//Page page = (Page)regionData[0];
//LayoutManager layoutManager = (LayoutManager)regionData[1];
Added:
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
(rev 0)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,10 @@
+<module>
+ <!-- Inherit the core Web Toolkit stuff -->
+ <inherits name="com.google.gwt.user.User"/>
+
+ <!-- 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"/>
+</module>
Added:
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
(rev 0)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/index.html 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,44 @@
+<html>
+ <head>
+
+ <!-- -->
+ <!-- Any title is fine -->
+ <!-- -->
+ <title>JBoss Portal</title>
+
+ <link href="portal.css" rel="stylesheet"
type="text/css">
+
+ <!-- -->
+ <!-- This script loads your compiled module. -->
+ <!-- If you add any GWT meta tags, they must -->
+ <!-- be added before this line. -->
+ <!-- -->
+ <script language='javascript'
src='prototype.js'></script>
+ <script language='javascript'
src='org.jboss.portal.uiserver.ajax.Portal.nocache.js'></script>
+ </head>
+
+ <!-- -->
+ <!-- The body can have arbitrary html, or -->
+ <!-- you can leave the body empty if you want -->
+ <!-- to create a completely dynamic ui -->
+ <!-- -->
+ <body>
+ <!-- OPTIONAL: include this if you want history support -->
+ <iframe src="javascript:''" id="__gwt_historyFrame"
style="width:0;height:0;border:0"></iframe>
+
+ <h1>JBoss Portal</h1>
+
+ <!-- AJAX Client for Portal Proof of Concept -->
+ <p>
+ Asynchronous Page Management
+ </p>
+ <table align="center">
+ <tr>
+ <td id="pageNavigator"></td>
+ </tr>
+ <tr>
+ <td id="currentPage"></td>
+ </tr>
+ </table>
+ </body>
+</html>
Added:
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
(rev 0)
+++
branches/UIServer/uiserver/src/resources/portal-uiserver.sar/META-INF/jboss-service.xml 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+ <mbean
+ code="org.jboss.portal.uiserver.service.UIServer"
+ name="portal:service=Controller"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortalObjectReader"
proxy-type="attribute">portal:container=PortalObjectReader</depends>
+ <depends optional-attribute-name="Processor"
proxy-type="attribute">portal:service=Processor</depends>
+ <depends>portal:service=PageService</depends>
+ <depends>portal:commandFactory=DefaultPortal</depends>
+ <depends>portal:urlFactory=Delegating</depends>
+ <depends>portal:service=InterceptorStackFactory,type=Command</depends>
+ <depends>portal:container=Instance</depends>
+ <depends>portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends>portal:service=CustomizationManager</depends>
+ <depends>portal:service=ContentProviderRegistry</depends>
+ <depends>portal:service=ResponseHandler,type=Selector</depends>
+ <depends>portal:service=ControlPolicy,type=Page</depends>
+ </mbean>
+</server>
Added: branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/jboss-web.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/jboss-web.xml
(rev 0)
+++
branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/jboss-web.xml 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<jboss-web>
+</jboss-web>
\ No newline at end of file
Added: branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/web.xml
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/web.xml
(rev 0)
+++
branches/UIServer/uiserver/src/resources/portal-uiserver.war/WEB-INF/web.xml 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <!-- Add the GWT Client Filter to run the Portal in full Web 2.0 Ajax Mode. In
turn, to run in Classic Html Mode, turn this filter off -->
+ <filter>
+ <filter-name>GWTClientFilter</filter-name>
+
<filter-class>org.jboss.portal.uiserver.service.GWTClientFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <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>
+
<servlet-class>org.jboss.portal.uiserver.service.PortalEntryPoint</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>controllerFactoryName</param-name>
+ <param-value>portal:service=ControllerFactory</param-value>
+ <description>The request controller factory for the portal
servlet</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>
+
+ <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 -->
+ <servlet>
+ <servlet-name>PortletService</servlet-name>
+
<servlet-class>org.jboss.portal.uiserver.service.PortletServiceImpl</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </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>
+ -->
+</web-app>
Added: branches/UIServer/uiserver/src/resources/portal-uiserver.war/asyncPages.html
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.war/asyncPages.html
(rev 0)
+++
branches/UIServer/uiserver/src/resources/portal-uiserver.war/asyncPages.html 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,7 @@
+<html>
+ <head>
+ <meta http-equiv="refresh"
content="0;url=org.jboss.portal.uiserver.ajax.AsyncPages/asyncPages.html">
+ </head>
+ <body>
+ </body>
+</html>
\ No newline at end of file
Added: branches/UIServer/uiserver/src/resources/portal-uiserver.war/layout.html
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.war/layout.html
(rev 0)
+++ branches/UIServer/uiserver/src/resources/portal-uiserver.war/layout.html 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,7 @@
+<html>
+ <head>
+ <meta http-equiv="refresh"
content="0;url=org.jboss.portal.uiserver.ajax.PortalLayout/layout.html">
+ </head>
+ <body>
+ </body>
+</html>
\ No newline at end of file
Added: branches/UIServer/uiserver/src/resources/portal-uiserver.war/partialRefresh.html
===================================================================
--- branches/UIServer/uiserver/src/resources/portal-uiserver.war/partialRefresh.html
(rev 0)
+++
branches/UIServer/uiserver/src/resources/portal-uiserver.war/partialRefresh.html 2007-10-18
06:17:01 UTC (rev 8686)
@@ -0,0 +1,7 @@
+<html>
+ <head>
+ <meta http-equiv="refresh"
content="0;url=org.jboss.portal.uiserver.ajax.PartialRefresh/partialRefresh.html">
+ </head>
+ <body>
+ </body>
+</html>
\ No newline at end of file