Author: sohil.shah(a)jboss.com
Date: 2007-11-09 19:16:51 -0500 (Fri, 09 Nov 2007)
New Revision: 8861
Added:
branches/UIServer/uiserver/gwt-dev-env/MyGWT(uiserver).launch
branches/UIServer/uiserver/gwt-dev-env/mygwt.jar
branches/UIServer/uiserver/gwt-dev-env/src/cmsPortlet.html
branches/UIServer/uiserver/gwt-dev-env/src/jspPortlet.html
branches/UIServer/uiserver/gwt-dev-env/src/weatherPortlet.html
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/MyGWTPrototype.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/layout/LayoutManager.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/widget/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/widget/PortletWindow.java
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/MyGWT.gwt.xml
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_maximize.gif
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_minimize.gif
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_normal.gif
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/mygwt.html
Modified:
branches/UIServer/uiserver/gwt-dev-env/AsyncPages(uiserver).launch
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/AsyncPages.java
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/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/Portal.gwt.xml
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/asyncPages.html
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/portal.css
Log:
first pass of integrating MyGWT into the Ajax User Agent
Modified: branches/UIServer/uiserver/gwt-dev-env/AsyncPages(uiserver).launch
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/AsyncPages(uiserver).launch 2007-11-09 20:47:23
UTC (rev 8860)
+++ branches/UIServer/uiserver/gwt-dev-env/AsyncPages(uiserver).launch 2007-11-10 00:16:51
UTC (rev 8861)
@@ -8,8 +8,8 @@
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
containerPath="org.eclipse.jdt.launching.JRE_CONTAINER"
javaProject="UIServer" path="1"
type="4"/> "/>
<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/src/main" path="3"
type="2"/> "/>
+<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/gwt-dev-env/src"
path="3" type="2"/> "/>
<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/src/resources/client/ajax/src"
path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/gwt-dev-env/src"
path="3" type="2"/> "/>
<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento
exportedEntriesOnly="false"
project="UIServer"/> </runtimeClasspathEntry> "/>
<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/gwt-dev-env/gwt-dev-linux.jar"
path="3" type="2"/> "/>
</listAttribute>
Added: branches/UIServer/uiserver/gwt-dev-env/MyGWT(uiserver).launch
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/MyGWT(uiserver).launch
(rev 0)
+++ branches/UIServer/uiserver/gwt-dev-env/MyGWT(uiserver).launch 2007-11-10 00:16:51 UTC
(rev 8861)
@@ -0,0 +1,27 @@
+<?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="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
containerPath="org.eclipse.jdt.launching.JRE_CONTAINER"
javaProject="UIServer" path="1"
type="4"/> "/>
+<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/src/main" path="3"
type="2"/> "/>
+<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/gwt-dev-env/src"
path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/src/resources/client/ajax/src"
path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento
exportedEntriesOnly="false"
project="UIServer"/> </runtimeClasspathEntry> "/>
+<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/gwt-dev-env/gwt-dev-linux.jar"
path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0"
encoding="UTF-8"?> <runtimeClasspathEntry
internalArchive="/UIServer/uiserver/gwt-dev-env/mygwt.jar"
path="3" type="2"/> "/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
value="-out www org.jboss.portal.uiserver.ajax.MyGWT/mygwt.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>
Added: branches/UIServer/uiserver/gwt-dev-env/mygwt.jar
===================================================================
(Binary files differ)
Property changes on: branches/UIServer/uiserver/gwt-dev-env/mygwt.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/UIServer/uiserver/gwt-dev-env/src/cmsPortlet.html
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/src/cmsPortlet.html
(rev 0)
+++ branches/UIServer/uiserver/gwt-dev-env/src/cmsPortlet.html 2007-11-10 00:16:51 UTC
(rev 8861)
@@ -0,0 +1,81 @@
+<style type="text/css">
+ #welcomelogo {
+ float: left;
+ margin: 30px 0px 30px 15px;
+ }
+
+ #welcometext {
+ margin: 30px 50px 30px 225px;
+ }
+
+ #welcomegreybox {
+ padding: 15px;
+ margin-bottom: 30px;
+ }
+
+ #welcomegreyboxTD {
+ border-left: 1px solid #d5d5d5;
+ padding-left: 15px;
+ }
+
+ #welcomegreybox h3 {
+ color: #5078aa;
+ font: bold 13px Helvetica, Arial, sans-serif;
+ }
+</style>
+
+<!--
+<div>
+ <img src="/portal/content/default/images/homeimg_main.png"
width="560" height="160"/>
+</div>
+-->
+
+<!--
+<div id="welcomelogo"><img
src="/portal/content/default/images/homeimg_jbosslogo.png" width="143"
height="64"/></div>
+-->
+
+
+<p id="welcometext">JBoss Portal provides an open source platform for
hosting and serving a portal Web interface,
+ publishing and managing its content, and customizing its experience. While most
packaged Portal frameworks help
+ enterprises launch Portals more quickly, only JBoss Portal delivers the benefits of a
zero-cost open source license
+ combined with a flexible and scalable underling platform.</p>
+
+<div id="welcomegreybox">
+ <table width="100%">
+ <tr>
+ <td valign="top"><h3>Support Services</h3>
+ <p>
+ JBoss Inc. offers various support services tailored to fit your needs. <a
href="portal/index.html">Explore</a>
+ support and service options for JBoss Portal.
+ </p>
+ </td>
+ <td valign="top"
id="welcomegreyboxTD"><h3>PortletSwap</h3>
+ <p>
+ <a
href="http://www.portletswap.com">Portletswap.com</a> is an open
community sponsored by JBoss, Inc. to facilitate the exchange of portlets and layouts for
use in JBoss Portal.
+ </p>
+ </td>
+ <td valign="top"
id="welcomegreyboxTD"><h3>Project Information</h3>
+ <p>Learn more about the <a
href="/portal/index.html">JBoss Portal project</a>, on-going
development, open
+ issues, and our
+ user and developer communities.
+ </p>
+ </td>
+ </tr>
+ </table>
+
+</div>
+<p>Thank you for downloading and deploying JBoss Portal. We hope your enjoy working
with it as much as we enjoy
+ developing it!</p>
+<p>Baci e abbracci,<br/>
+ The JBoss Portal Team.
+</p>
+
+<br/>
+
+<div>
+ <form name="testForm" method="post"
action="portal/index.html">
+ <span>Param1:</span><input type="text"
name="param1"/><br/>
+ <span>Param2:</span><input type="text"
name="param2"/><br/>
+ <input type="submit"/>
+ </form>
+</div>
\ No newline at end of file
Added: branches/UIServer/uiserver/gwt-dev-env/src/jspPortlet.html
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/src/jspPortlet.html
(rev 0)
+++ branches/UIServer/uiserver/gwt-dev-env/src/jspPortlet.html 2007-11-10 00:16:51 UTC
(rev 8861)
@@ -0,0 +1,42 @@
+<div class="portlet-container"><table width="100%"
border="0" cellpadding="0"
cellspacing="0"><tr><td
class="portlet-titlebar-left"></td><td
class="portlet-titlebar-center"><div
class="portlet-titlebar-decoration"></div><span
class="portlet-titlebar-title">Greetings!</span><div
class="portlet-mode-container"><span title="minimized"><a
class="portlet-mode-minimized"
href="/portal/portal/default/default/JSPPortletWindow?windowstate=minimized"> </a></span><span
title="maximized"><a class="portlet-mode-maximized"
href="/portal/portal/default/default/JSPPortletWindow?windowstate=maximized"> </a></span></div></td><td
class="portlet-titlebar-right"></td></tr><tr><td
class="portlet-content-left"></td><td
class="portlet-body"><div class="portlet-content-center">
+
+<table border="0" cellspacing="2" cellpadding="2">
+ <tr>
+ <td align="center"><a
href="http://portal.demo.jboss.com" target="_blank"><img
+ src="/portal-jsp-samples/images/dodemo.gif" border="0"
+ alt="Try the latest release of JBoss Portal, live and
online."></a>
+ <a
href="http://labs.jboss.com/portal/jbossportal/download/index.html&q...
target="_blank"><img
+ src="/portal-jsp-samples/images/getcode.gif" border="0"
+ alt="Download JBoss Portal and have it up and running in
minutes."></a>
+ <a href="http://www.portletswap.com"
target="_blank"><img
+ src="/portal-jsp-samples/images/accessorize.gif"
border="0"
+ alt="Download portlets and layouts for your new JBoss Portal
installation."></a></td>
+ </tr>
+ <tr>
+
+ <td></td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate">
+ <font class="portlet-font">This is a basic installation of
<b>JBoss Portal 2.8.0-SNAPSHOT</b>. You may
+ log in at any time, using the <i>Login</i> link at the top-right
of this page, with the following
+ credentials:</font>
+ </td>
+
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center">
+ <b>user/user</b> or <b>admin/admin</b>
+ </td>
+ </tr>
+ <tr>
+
+ <td align="center">
+ If you are in need of guidance with regards to navigating, configuring, or
operating the portal, please view
+ our <a
href="http://labs.jboss.com/portal/jbossportal/docs/index.html"
target="_blank">online documentation</a>.
+ </td>
+ </tr>
+</table>
+</div></td><td
class="portlet-content-right"></td></tr><tr><td
class="portlet-footer-left"></td><td
class="portlet-footer-center"></td><td
class="portlet-footer-right"></td></tr></table>
+
+</div>
\ No newline at end of file
Added: branches/UIServer/uiserver/gwt-dev-env/src/weatherPortlet.html
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/src/weatherPortlet.html
(rev 0)
+++ branches/UIServer/uiserver/gwt-dev-env/src/weatherPortlet.html 2007-11-10 00:16:51 UTC
(rev 8861)
@@ -0,0 +1,76 @@
+<div class="portlet-container"><table width="100%"
border="0" cellpadding="0"
cellspacing="0"><tr><td
class="portlet-titlebar-left"></td><td
class="portlet-titlebar-center"><div
class="portlet-titlebar-decoration"></div><span
class="portlet-titlebar-title">Weather Portlet</span><div
class="portlet-mode-container"><span title="minimized"><a
class="portlet-mode-minimized"
href="/portal/portal/default/default/2?windowstate=minimized"> </a></span><span
title="maximized"><a class="portlet-mode-maximized"
href="/portal/portal/default/default/2?windowstate=maximized"> </a></span></div></td><td
class="portlet-titlebar-right"></td></tr><tr><td
class="portlet-content-left"></td><td
class="portlet-body"><div
class="portlet-content-center"><br/>
+<div align="center">
+<font>
+<b>Miami, FL, US</b>
+</font>
+
+<br/>
+<br/>
+<table border="0" width="130">
+<tr>
+<td>
+<table height="130" border="0">
+<tr>
+<td align="center"
class="portlet-section-header">Currently</td>
+</tr>
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">
+<img
src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52//28.gif"/>
+</td>
+</tr>
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">Mostly Cloudy</td>
+
+</tr>
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">86F</td>
+</tr>
+</table>
+</td>
+<td>
+<table height="130" border="0">
+<tr>
+<td valign="top" align="center"
class="portlet-section-header">Thu</td>
+</tr>
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">
+<img
src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52//38.gif"/>
+</td>
+
+</tr>
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">Scattered Thunderstorms</td>
+</tr>
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">76F/86F</td>
+</tr>
+</table>
+</td>
+<td>
+<table height="130" border="0">
+<tr>
+<td valign="top" align="center"
class="portlet-section-header">Fri</td>
+</tr>
+
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">
+<img
src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52//38.gif"/>
+</td>
+</tr>
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">Scattered Thunderstorms</td>
+</tr>
+<tr>
+<td valign="top" align="center"
class="portlet-section-alternate">78F/89F</td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+
+<br/>
+<a target="_blank"
href="http://us.rd.yahoo.com/dailynews/rss/weather/Miami__FL/*http:/...
Forecast</a>
+</div>
+</div></td><td
class="portlet-content-right"></td></tr><tr><td
class="portlet-footer-left"></td><td
class="portlet-footer-center"></td><td
class="portlet-footer-right"></td></tr></table>
+
+</div>
\ No newline at end of file
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-09
20:47:23 UTC (rev 8860)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/AsyncPages.java 2007-11-10
00:16:51 UTC (rev 8861)
@@ -33,11 +33,6 @@
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;
@@ -46,6 +41,15 @@
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import net.mygwt.ui.client.widget.ContentPanel;
+import net.mygwt.ui.client.widget.IconButton;
+import net.mygwt.ui.client.widget.WidgetContainer;
+import net.mygwt.ui.client.widget.Viewport;
+import net.mygwt.ui.client.widget.layout.*;
+import net.mygwt.ui.client.Style;
+import net.mygwt.ui.client.event.Listener;
+import net.mygwt.ui.client.event.BaseEvent;
+
import org.jboss.portal.uiserver.ajax.client.protocol.Page;
import org.jboss.portal.uiserver.ajax.client.protocol.Window;
@@ -56,36 +60,66 @@
*
*/
public class AsyncPages implements EntryPoint
-{
+{
/**
- * This is the entry point method.
+ *
*/
- public void onModuleLoad()
- {
- this.loadPortal();
- }
+ private Viewport viewport = null;
/**
*
- *
*/
- private void loadPortal()
- {
+ private WidgetContainer north = null;
+
+ /**
+ *
+ */
+ private WidgetContainer west = null;
+
+ /**
+ *
+ */
+ private WidgetContainer center = null;
+
+
+ /**
+ * This is the entry point method.
+ */
+ public void onModuleLoad()
+ {
+ //Initialize the Viewport
+ this.viewport = new Viewport();
+
+ //Layout for the viewport
+ BorderLayout pageLayout = new BorderLayout();
+
+ //Layout for the north region (Header/Navigation related content produced by the
portal are laid out here)
+ FlowLayout northLayout = new FlowLayout();
+
+ //Setup the layout of the root container of the page
+ this.viewport.setLayout(pageLayout);
+
+ //Setup the north region of the page
+ this.north = new WidgetContainer();
+ this.north.setLayout(northLayout);
+ float northSize = this.viewport.getOffsetHeight() * ((float)0.05);
+ BorderLayoutData northData = new BorderLayoutData(Style.NORTH, northSize);
+ northData.resizeable = true;
+ this.viewport.add(this.north, northData);
+
//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.selectTab(0);
pageNavigator.addTabListener(new TabListenerImpl());
- RootPanel.get("pageNavigator").add(pageNavigator);
+ this.north.add(pageNavigator);
+
+ //Load the Portal Page
+ this.loadPartialRefreshPage("Page 1");
+ }
- //Load the main page to be displayed
- HorizontalPanel page = new HorizontalPanel();
- RootPanel.get("currentPage").add(page);
- this.loadPartialRefreshPage("Page 1");
- }
-
/**
*
*
@@ -113,6 +147,197 @@
/**
*
+ * @param portalPage
+ */
+ private void displayPortalPage(Page portalPage)
+ {
+ //A Viewport resizing listener
+
+
+ //Dispalying the fully aggregated page
+ Window[] windows = portalPage.getWindows();
+ int column = 0;
+
+ this.setUpPortletRegions();
+
+ //Fill up the page with portlet windows
+ for(int i=0; i<windows.length; i++)
+ {
+ Window pageWindow = windows[i];
+ if(pageWindow.isVisible())
+ {
+ //Add this window to the Page
+ if(column == 0 && windows.length>1)
+ {
+ this.west.add(this.getPortletWindow(pageWindow.getName(),
pageWindow.getContent()));
+ column ++;
+ }
+ else
+ {
+ this.center.add(this.getPortletWindow(pageWindow.getName(),
pageWindow.getContent()));
+ column = 0;
+ }
+ }
+ }
+
+ //render the page
+ this.viewport.layout(true);
+ }
+
+ /**
+ *
+ * @param content
+ * @return
+ */
+ private ContentPanel getPortletWindow(String windowName, String content)
+ {
+ ContentPanel portletWindow = new ContentPanel(Style.HEADER);
+ portletWindow.setId(windowName);
+ HTML windowContent = new HTML(content);
+
+
+ //Setup listeners
+ //Event Listener for the decoration components like
+ //Normal, Maximized, Minimized
+ Listener listener = new Listener()
+ {
+ public void handleEvent(BaseEvent event)
+ {
+ IconButton cour = (IconButton)event.widget;
+ String id = cour.getId();
+ String windowName = id.substring(0, id.indexOf(':'));
+ String action = id.substring(id.indexOf(':')+1);
+ if(action.equals("restore"))
+ {
+ handleWindowStateChanged(windowName, Window.NORMAL);
+ }
+ else if(action.equals("minimize"))
+ {
+ handleWindowStateChanged(windowName, Window.MINIMIZED);
+ }
+ else if(action.equals("maximize"))
+ {
+ handleWindowStateChanged(windowName, Window.MAXIMIZED);
+ }
+ else if(action.equals("save"))
+ {
+ handleWindowModeChanged(windowName, Window.EDIT);
+ }
+ }
+ };
+ IconButton save = new IconButton("my-tool-save");
+ save.setId(windowName+":save");
+ IconButton help = new IconButton("my-tool-help");
+ help.setId(windowName+":help");
+ IconButton restore = new IconButton("my-tool-restore");
+ restore.setId(windowName+":restore");
+ IconButton minimize = new IconButton("my-tool-minimize");
+ minimize.setId(windowName+":minimize");
+ IconButton maximize = new IconButton("my-tool-maximize");
+ maximize.setId(windowName+":maximize");
+ portletWindow.addButton(save, listener);
+ portletWindow.addButton(help, listener);
+ portletWindow.addButton(restore, listener);
+ portletWindow.addButton(minimize, listener);
+ portletWindow.addButton(maximize, listener);
+
+ //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);
+ }
+ }
+ }
+ };
+ windowContent.addClickListener(contentListener);
+
+ //Add the content
+ portletWindow.add(windowContent);
+
+ return portletWindow;
+ }
+
+ /**
+ *
+ *
+ */
+ private void setUpPortletRegions()
+ {
+ if(this.west != null)
+ {
+ this.viewport.remove(this.west);
+ }
+ if(this.center != null)
+ {
+ this.viewport.remove(this.center);
+ }
+
+ //Re-add these two regions
+ //Layout for the west region (Portlet Windows are laid out here)
+ FlowLayout westLayout = new FlowLayout();
+ westLayout.spacing = 5;
+ westLayout.margin = 5;
+
+ //Layout for the center region (Portlet Windows are laid out here)
+ FlowLayout centerLayout = new FlowLayout();
+ centerLayout.spacing = 5;
+ centerLayout.margin = 5;
+
+ //Setup the west region of the page
+ this.west = new WidgetContainer();
+ this.west.setScrollEnabled(true);
+ this.west.setLayout(westLayout);
+ float westSize = this.viewport.getOffsetWidth() * ((float)0.2);
+ BorderLayoutData westData = new BorderLayoutData(Style.WEST, westSize);
+ westData.resizeable = true;
+ this.viewport.add(this.west, westData);
+
+ //Setup the center region of the page
+ this.center = new WidgetContainer();
+ this.center.setScrollEnabled(true);
+ this.center.setLayout(centerLayout);
+ BorderLayoutData centerData = new BorderLayoutData(Style.CENTER);
+ centerData.resizeable = true;
+ this.viewport.add(this.center, centerData);
+ }
+
+ /**
+ *
* @param window
* @param newState
*/
@@ -210,9 +435,10 @@
public void onCompletion(String responseText)
{
HTML html = new HTML(responseText);
- Panel window = (Panel)this.windowContent.getParent();
- this.windowContent.removeFromParent();
+ ContentPanel window = (ContentPanel)this.windowContent.getParent();
+ window.remove(this.windowContent);
window.add(html);
+ window.layout(true);
}
}
@@ -227,6 +453,11 @@
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 == null)
+ {
+ return false;
+ }
+
if(url.startsWith(basePortalURL))
{
//This is an Absolute URL, but it points back to
@@ -298,129 +529,7 @@
/*-{
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.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);
- }
- }
- }
-
+ }-*/;
//------------Page Navigation related
logic-----------------------------------------------------------------------------------------------------
/**
*
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/MyGWTPrototype.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/MyGWTPrototype.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/MyGWTPrototype.java 2007-11-10
00:16:51 UTC (rev 8861)
@@ -0,0 +1,114 @@
+/******************************************************************************
+ * 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.ajax.client;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.HTML;
+
+import net.mygwt.ui.client.Style;
+import net.mygwt.ui.client.event.BaseEvent;
+import net.mygwt.ui.client.event.SelectionListener;
+import net.mygwt.ui.client.widget.Button;
+import net.mygwt.ui.client.widget.IconButton;
+import net.mygwt.ui.client.widget.ButtonBar;
+import net.mygwt.ui.client.widget.Info;
+import net.mygwt.ui.client.widget.ContentPanel;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class MyGWTPrototype implements EntryPoint
+{
+ /**
+ *
+ */
+ public void onModuleLoad()
+ {
+ VerticalPanel panel = new VerticalPanel();
+ RootPanel.get("currentPage").add(panel);
+
+ // Fillup panel with MyGWT widgets for testing
+ this.createButtonWidget(panel);
+ this.createPortletWindowWidget(panel);
+ }
+
+ /**
+ *
+ * @param container
+ */
+ private void createButtonWidget(VerticalPanel panel)
+ {
+ SelectionListener listener = new SelectionListener()
+ {
+ public void widgetSelected(BaseEvent be)
+ {
+ Button btn = (Button) be.widget;
+ Info.show("Click Event", "The '{0}' button was
clicked.", btn
+ .getText());
+ }
+ };
+
+ ButtonBar buttonBar = new ButtonBar(Style.LEFT);
+ buttonBar.add(new Button("Click Me", listener));
+
+ Button iconBtn = new Button("Icon Button", listener);
+ iconBtn.setIconStyle("window-maximize-button");
+ buttonBar.add(iconBtn);
+
+ Button disabled = new Button("Disabled", listener);
+ disabled.setEnabled(false);
+ buttonBar.add(disabled);
+
+ panel.add(buttonBar);
+ }
+
+ /**
+ *
+ * @param panel
+ */
+ private void createPortletWindowWidget(VerticalPanel panel)
+ {
+ HTML html = new HTML("<div
class=\"window-normal-button\">Normal</div><br/><div
class=\"window-minimize-button\">Minimize</div><br/><div
class=\"window-maximize-button\">Maximize</div>");
+
+ ContentPanel contentPanel = new ContentPanel(Style.HEADER);
+ contentPanel.addButton(new IconButton("my-tool-save"), null);
+ contentPanel.addButton(new IconButton("my-tool-help"), null);
+ contentPanel.addButton(new IconButton("my-tool-restore"), null);
+ contentPanel.addButton(new IconButton("my-tool-minimize"), null);
+ contentPanel.addButton(new IconButton("my-tool-maximize"), null);
+
+ Button normalButton = new Button("", null);
+ normalButton.setIconStyle("window-normal-button");
+
+ IconButton iconNormalButton = new IconButton("window-minimize-button");
+
+ contentPanel.add(html);
+ contentPanel.add(normalButton);
+ contentPanel.add(iconNormalButton);
+
+ panel.add(contentPanel);
+ }
+}
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-09
20:47:23 UTC (rev 8860)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/Portal.java 2007-11-10
00:16:51 UTC (rev 8861)
@@ -22,32 +22,21 @@
******************************************************************************/
package org.jboss.portal.uiserver.ajax.client;
+import java.util.List;
+import java.util.ArrayList;
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.FlexTable;
-
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;
import org.jboss.portal.uiserver.ajax.client.protocol.Page;
import org.jboss.portal.uiserver.ajax.client.protocol.Window;
+import org.jboss.portal.uiserver.ajax.client.widget.PortletWindow;
+import org.jboss.portal.uiserver.ajax.client.layout.LayoutManager;
/**
* This is the Entry Point of the client-side Ajax agent of the Presentation Framework
@@ -61,24 +50,9 @@
* This is the entry point method.
*/
public void onModuleLoad()
- {
- //HorizontalPanel page = new HorizontalPanel();
- //RootPanel.get("currentPage").add(page);
- FlexTable page = new FlexTable();
- RootPanel.get("currentPage").add(page);
-
- this.loadPortal();
- }
-
- /**
- *
- *
- */
- private void loadPortal()
- {
+ {
PortalRPCAsync portalRPC = (PortalRPCAsync)GWT.create(PortalRPC.class);
-
((ServiceDefTarget)portalRPC).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
-
+
((ServiceDefTarget)portalRPC).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
AsyncCallback callback = new AsyncCallback()
{
public void onSuccess(Object result)
@@ -90,318 +64,31 @@
public void onFailure(Throwable caught)
{
}
- };
-
+ };
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();
- FlexTable page = (FlexTable)RootPanel.get("currentPage").getWidget(0);
- page.clear();
- for(int i=0; i<windows.length; i++)
+ if(windows != null && windows.length>0)
{
- Window pageWindow = windows[i];
- if(pageWindow.isVisible())
+ List displayWindows = new ArrayList();
+ for(int i=0; i<windows.length; i++)
{
- 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.setWidget(0,0,window);
- }
- }
- }
-
//-------------------------------------------------------------------------------------------------------------------------------------------------
- /**
- *
- * @param window
- * @param newState
- */
- /*private void handleWindowStateChanged(String window, String newState)
- {
- PortletServiceAsync portletService =
(PortletServiceAsync)GWT.create(PortletService.class);
-
((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
-
- 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()+"/portalrpc");
-
- 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(""))
+ Window pageWindow = windows[i];
+ if(pageWindow.isVisible())
{
- 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;
- }
+ PortletWindow portletWindow = new PortletWindow(pageWindow);
+ displayWindows.add(portletWindow);
}
- 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;
- }-*/;
+ LayoutManager.doLayout(displayWindows);
+ }
+ }
}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/layout/LayoutManager.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/layout/LayoutManager.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/layout/LayoutManager.java 2007-11-10
00:16:51 UTC (rev 8861)
@@ -0,0 +1,164 @@
+/******************************************************************************
+ * 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.ajax.client.layout;
+
+import java.util.List;
+
+import com.google.gwt.user.client.ui.Widget;
+
+import net.mygwt.ui.client.widget.Viewport;
+import net.mygwt.ui.client.widget.WidgetContainer;
+import net.mygwt.ui.client.widget.layout.BorderLayout;
+import net.mygwt.ui.client.widget.layout.BorderLayoutData;
+import net.mygwt.ui.client.widget.layout.FlowLayout;
+import net.mygwt.ui.client.Style;
+
+import org.jboss.portal.uiserver.ajax.client.widget.PortletWindow;
+
+/**
+ * This layout manager provides a Flexible Grid for laying out the UI components (which
would be Portlet Windows)
+ * inside a flexible coordinates based Grid
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class LayoutManager
+{
+ /**
+ *
+ */
+ private static Viewport viewport = null;
+
+ /**
+ *
+ */
+ private static WidgetContainer north = null;
+
+ /**
+ *
+ */
+ private static WidgetContainer west = null;
+
+ /**
+ *
+ */
+ private static WidgetContainer center = null;
+
+
+ /**
+ *
+ */
+ static
+ {
+ LayoutManager.viewport = new Viewport();
+
+ //Layout for the viewport
+ BorderLayout pageLayout = new BorderLayout();
+
+ //Layout for the north region (Header/Navigation related content produced by the
portal are laid out here)
+ FlowLayout northLayout = new FlowLayout();
+
+ //Setup the layout of the root container of the page
+ LayoutManager.viewport.setLayout(pageLayout);
+
+ //Setup the north region of the page
+ LayoutManager.north = new WidgetContainer();
+ LayoutManager.north.setLayout(northLayout);
+ float northSize = LayoutManager.viewport.getOffsetHeight() * ((float)0.05);
+ BorderLayoutData northData = new BorderLayoutData(Style.NORTH, northSize);
+ northData.resizeable = true;
+ LayoutManager.viewport.add(LayoutManager.north, northData);
+ }
+
+ /**
+ *
+ * @param displayWindows
+ */
+ public static void doLayout(List displayWindows)
+ {
+ LayoutManager.setUpPortletRegions();
+
+ int column = 0;
+ for(int i=0; i<displayWindows.size(); i++)
+ {
+ PortletWindow portletWindow = (PortletWindow)displayWindows.get(i);
+ Widget window = portletWindow.create();
+ //Add this window to the Page
+ if(column == 0 && displayWindows.size()>1)
+ {
+ LayoutManager.west.add(window);
+ column ++;
+ }
+ else
+ {
+ LayoutManager.center.add(window);
+ column = 0;
+ }
+ }
+ LayoutManager.viewport.layout(true);
+ }
+
+ /**
+ *
+ *
+ */
+ private static void setUpPortletRegions()
+ {
+ if(LayoutManager.west != null)
+ {
+ LayoutManager.viewport.remove(LayoutManager.west);
+ }
+ if(LayoutManager.center != null)
+ {
+ LayoutManager.viewport.remove(LayoutManager.center);
+ }
+
+ //Re-add these two regions
+ //Layout for the west region (Portlet Windows are laid out here)
+ FlowLayout westLayout = new FlowLayout();
+ westLayout.spacing = 5;
+ westLayout.margin = 5;
+
+ //Layout for the center region (Portlet Windows are laid out here)
+ FlowLayout centerLayout = new FlowLayout();
+ centerLayout.spacing = 5;
+ centerLayout.margin = 5;
+
+ //Setup the west region of the page
+ LayoutManager.west = new WidgetContainer();
+ LayoutManager.west.setScrollEnabled(true);
+ LayoutManager.west.setLayout(westLayout);
+ float westSize = LayoutManager.viewport.getOffsetWidth() * ((float)0.2);
+ BorderLayoutData westData = new BorderLayoutData(Style.WEST, westSize);
+ westData.resizeable = true;
+ LayoutManager.viewport.add(LayoutManager.west, westData);
+
+ //Setup the center region of the page
+ LayoutManager.center = new WidgetContainer();
+ LayoutManager.center.setScrollEnabled(true);
+ LayoutManager.center.setLayout(centerLayout);
+ BorderLayoutData centerData = new BorderLayoutData(Style.CENTER);
+ centerData.resizeable = true;
+ LayoutManager.viewport.add(LayoutManager.center, centerData);
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/widget/PortletWindow.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/widget/PortletWindow.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ajax/client/widget/PortletWindow.java 2007-11-10
00:16:51 UTC (rev 8861)
@@ -0,0 +1,383 @@
+/******************************************************************************
+ * 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.ajax.client.widget;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.ClickListener;
+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.FlexTable;
+
+import net.mygwt.ui.client.widget.ContentPanel;
+import net.mygwt.ui.client.Style;
+import net.mygwt.ui.client.widget.IconButton;
+import net.mygwt.ui.client.widget.Info;
+import net.mygwt.ui.client.event.Listener;
+import net.mygwt.ui.client.event.Listener;
+import net.mygwt.ui.client.event.BaseEvent;
+
+import org.jboss.portal.uiserver.ajax.client.protocol.Window;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PortletWindow
+{
+ /**
+ *
+ */
+ private Window window = null;
+
+ /**
+ *
+ *
+ */
+ public PortletWindow(Window window)
+ {
+ this.window = window;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ContentPanel create()
+ {
+ ContentPanel portletWindow = new ContentPanel(Style.HEADER);
+ String windowName = this.window.getName();
+ String content = this.window.getContent();
+ portletWindow.setId(windowName);
+ HTML windowContent = new HTML(content);
+
+
+ //Setup listeners
+ //Event Listener for the decoration components like
+ //Normal, Maximized, Minimized
+ Listener listener = new Listener()
+ {
+ public void handleEvent(BaseEvent event)
+ {
+ IconButton cour = (IconButton)event.widget;
+ String id = cour.getId();
+ String windowName = id.substring(0, id.indexOf(':'));
+ String action = id.substring(id.indexOf(':')+1);
+ if(action.equals("restore"))
+ {
+ //handleWindowStateChanged(windowName, Window.NORMAL);
+ Info.show("Normal", "Loading Normal Mode....",
"Loading Normal Mode....");
+ }
+ else if(action.equals("minimize"))
+ {
+ //handleWindowStateChanged(windowName, Window.MINIMIZED);
+ Info.show("Minimize", "Loading Minimize Mode....",
"Loading Minimize Mode....");
+ }
+ else if(action.equals("maximize"))
+ {
+ //handleWindowStateChanged(windowName, Window.MAXIMIZED);
+ Info.show("Maximize", "Loading Maximize Mode....",
"Loading Maximize Mode....");
+ }
+ else if(action.equals("save"))
+ {
+ //handleWindowModeChanged(windowName, Window.EDIT);
+ Info.show("Save", "Loading Save Mode....",
"Loading Save Mode....");
+ }
+ else if(action.equals("help"))
+ {
+ //handleWindowModeChanged(windowName, Window.EDIT);
+ Info.show("Help", "Loading Help Mode....",
"Loading Help Mode....");
+ }
+ }
+ };
+ IconButton save = new IconButton("my-tool-save");
+ save.setId(windowName+":save");
+ save.setToolTip("Edit");
+ IconButton help = new IconButton("my-tool-help");
+ help.setId(windowName+":help");
+ help.setToolTip("Help");
+ IconButton restore = new IconButton("my-tool-restore");
+ restore.setId(windowName+":restore");
+ restore.setToolTip("Normal");
+ IconButton minimize = new IconButton("my-tool-minimize");
+ minimize.setId(windowName+":minimize");
+ minimize.setToolTip("Minimize");
+ IconButton maximize = new IconButton("my-tool-maximize");
+ maximize.setId(windowName+":maximize");
+ maximize.setToolTip("Maximize");
+ portletWindow.addButton(save, listener);
+ portletWindow.addButton(help, listener);
+ portletWindow.addButton(restore, listener);
+ portletWindow.addButton(minimize, listener);
+ portletWindow.addButton(maximize, listener);
+
+ //Event Listener for actions perfomed inside the portlet window content
+ //itself. Used for performing Partial Refresh of a Portal Page
+ /*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);
+ }
+ }
+ }
+ };
+ windowContent.addClickListener(contentListener);*/
+
+ //Add the content
+ portletWindow.add(windowContent);
+
+ return portletWindow;
+ }
+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ * @param window
+ * @param newState
+ */
+ /*private void handleWindowStateChanged(String window, String newState)
+ {
+ PortletServiceAsync portletService =
(PortletServiceAsync)GWT.create(PortletService.class);
+
((ServiceDefTarget)portletService).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
+
+ 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()+"/portalrpc");
+
+ 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;
+ }-*/;
+}
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-09
20:47:23 UTC (rev 8860)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/GWTClientFilter.java 2007-11-10
00:16:51 UTC (rev 8861)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@@ -45,6 +46,13 @@
/**
*
*/
+ public void init(FilterConfig arg0) throws ServletException
+ {
+ }
+
+ /**
+ *
+ */
public void destroy()
{
}
@@ -81,50 +89,48 @@
//Now make sure the resource requested is a GWT resource
if( resource.equals("index.html") ||
resource.equals("portal.css") ||
+ resource.equals("mygwt-all.css") ||
+ resource.equals("mygwt-all-gray.css") ||
resource.equals("gwt.js") ||
resource.equals("prototype.js") ||
resource.contains(".cache.") ||
resource.contains(".nocache.") ||
- resource.contains(".gwt.rpc")
+ resource.contains(".gwt.rpc") ||
+ resource.contains("images/default") ||
+ resource.contains("images/gray")
)
{
- String gwtResource = this.readContent(resource);
- response.getOutputStream().write(gwtResource.getBytes());
+ byte[] gwtResource = this.readContent(resource);
+ response.getOutputStream().write(gwtResource);
response.getOutputStream().flush();
return;
}
}
-
- /**
- *
- */
- public void init(FilterConfig arg0) throws ServletException
- {
- }
/**
*
* @param path
* @return
*/
- private String readContent(String path)
+ private byte[] readContent(String path)
{
- String content = null;
+ byte[] content = null;
InputStream is = null;
+ ByteArrayOutputStream bos = null;
try
{
+ bos = new ByteArrayOutputStream();
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));
+ bos.write(cour);
+ bos.flush();
}
- content = contentBuffer.toString();
}
catch(Exception e)
{
@@ -136,6 +142,11 @@
{
try{is.close();}catch(Exception e){}
}
+ if(bos != null)
+ {
+ content = bos.toByteArray();
+ try{bos.close();}catch(Exception e){}
+ }
}
return content;
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-09
20:47:23 UTC (rev 8860)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/AsyncPages.gwt.xml 2007-11-10
00:16:51 UTC (rev 8861)
@@ -1,6 +1,8 @@
<module>
<!-- Inherit the core Web Toolkit stuff -->
<inherits name="com.google.gwt.user.User"/>
+ <!-- Inherit the MyGWT toolkit -->
+ <inherits name='net.mygwt.ui.MyGWT'/>
<!-- Specify the app entry point class -->
<entry-point class="org.jboss.portal.uiserver.ajax.client.AsyncPages"/>
Added:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/MyGWT.gwt.xml
===================================================================
---
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/MyGWT.gwt.xml
(rev 0)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/MyGWT.gwt.xml 2007-11-10
00:16:51 UTC (rev 8861)
@@ -0,0 +1,9 @@
+<module>
+ <!-- Inherit the core Web Toolkit stuff -->
+ <inherits name="com.google.gwt.user.User"/>
+ <!-- Inherit the MyGWT toolkit -->
+ <inherits name='net.mygwt.ui.MyGWT'/>
+
+ <!-- Specify the app entry point class -->
+ <entry-point
class="org.jboss.portal.uiserver.ajax.client.MyGWTPrototype"/>
+</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-09
20:47:23 UTC (rev 8860)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml 2007-11-10
00:16:51 UTC (rev 8861)
@@ -1,6 +1,8 @@
<module>
<!-- Inherit the core Web Toolkit stuff -->
<inherits name="com.google.gwt.user.User"/>
+ <!-- Inherit the MyGWT toolkit -->
+ <inherits name='net.mygwt.ui.MyGWT'/>
<!-- Specify the app entry point class -->
<entry-point class="org.jboss.portal.uiserver.ajax.client.Portal"/>
Modified:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/asyncPages.html
===================================================================
---
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/asyncPages.html 2007-11-09
20:47:23 UTC (rev 8860)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/asyncPages.html 2007-11-10
00:16:51 UTC (rev 8861)
@@ -22,23 +22,6 @@
<!-- 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>
-
- <!-- Asynchronous Portal Page Management 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>
</body>
</html>
Added:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_maximize.gif
===================================================================
(Binary files differ)
Property changes on:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_maximize.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_minimize.gif
===================================================================
(Binary files differ)
Property changes on:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_minimize.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_normal.gif
===================================================================
(Binary files differ)
Property changes on:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/images/ico_16_normal.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
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-09
20:47:23 UTC (rev 8860)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/index.html 2007-11-10
00:16:51 UTC (rev 8861)
@@ -22,20 +22,6 @@
<!-- 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>
- JBoss Portal
- </p>
- <table align="center">
- <tr>
- <td id="currentPage"></td>
- </tr>
- </table>
+ <body>
</body>
</html>
Added:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/mygwt.html
===================================================================
---
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/mygwt.html
(rev 0)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/mygwt.html 2007-11-10
00:16:51 UTC (rev 8861)
@@ -0,0 +1,30 @@
+<html>
+ <head>
+ <title>JBoss Portal</title>
+
+ <!-- portal styles defined here -->
+ <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='org.jboss.portal.uiserver.ajax.MyGWT.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>
+ <!-- MyGWT Proof of Concept -->
+ <h1>MyGWT Prototype</h1><br/>
+ <table align="center">
+ <tr>
+ <td id="currentPage"></td>
+ </tr>
+ </table>
+ </body>
+</html>
Modified:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/portal.css
===================================================================
---
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/portal.css 2007-11-09
20:47:23 UTC (rev 8860)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/public/portal.css 2007-11-10
00:16:51 UTC (rev 8861)
@@ -25,7 +25,19 @@
a:visited {
color: darkblue;
}
+/*----------------Client-Side Ajax Agent
styles-------------------------------------------------------------------------------------------------------------------------------*/
+.window-normal-button{
+ background: url(images/ico_16_normal.gif);
+}
+.window-minimize-button{
+ background: url(images/ico_16_minimize.gif);
+}
+
+.window-maximize-button{
+ background: url(images/ico_16_maximize.gif);
+}
+/*-------------Core GWT
styles------------------------------------------------------------------------------------------------------------------------------------*/
.gwt-BorderedPanel {
}
@@ -353,7 +365,6 @@
padding: 2px;
}
-/* -------------------------------------------------------------------------- */
.ks-Sink {
width: 100%;
height: 24em;