Author: sohil.shah(a)jboss.com
Date: 2008-01-03 01:51:22 -0500 (Thu, 03 Jan 2008)
New Revision: 9421
Added:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIContainer.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIContext.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIObject.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIPage.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIPortal.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIWindow.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxShowUIObjectResponse.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxUIObjectAction.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxUpdateWindowStateAction.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxViewUIObjectAction.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ClientResponse.java
Removed:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContainer.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContext.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIObject.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPage.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPortal.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIWindow.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/UIObjectAction.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ViewUIObjectAction.java
Modified:
branches/JBoss_Portal_Branch_2_6/build/build.xml
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralObjectImpl.java
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Portal.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Session.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Util.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/layout/LayoutManager.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/service/PortalRPC.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/service/PortalRPCAsync.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/widget/PortletWindow.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/AjaxUIController.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/ajax/entry/PortalEntryPoint.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/ObjectContext.java
Log:
Ajax User Agent - end-to-end window state related interactions
Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml 2008-01-03 00:21:34 UTC (rev 9420)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml 2008-01-03 06:51:22 UTC (rev 9421)
@@ -108,9 +108,7 @@
<!-- Sets up the module configuration. -->
<moduleconfig property="modules" selected="${groups}">
-
<!-- Modules -->
-
<module name="jems"/>
<module name="security"/>
<module name="faces"/>
@@ -118,28 +116,48 @@
<module name="server"/>
<module name="portlet-server"/>
<module name="theme"/>
- <module name="cms"/>
- <module name="format"/>
- <module name="core"/>
- <module name="core-cms"/>
+ <module name="format"/>
+ <module name="core"/>
+ <module name="registration"/>
+ <module name="presentation"/>
+ <module name="core-presentation"/>
+ <module name="core-samples"/>
+
+ <!--
+ <module name="search"/>
+ <module name="workflow"/>
+ <module name="cms"/>
+ <module name="core-cms"/>
+ -->
+ <!--
<module name="core-management"/>
<module name="core-identity"/>
<module name="core-admin"/>
+ -->
+ <!--
<module name="core-wsrp"/>
+ -->
+ <!--
<module name="search"/>
+ -->
+ <!--
<module name="core-samples"/>
+ -->
+ <!--
<module name="wsrp"/>
- <module name="registration"/>
+ -->
+ <!--
<module name="workflow"/>
+ -->
+ <!--
<module name="widget"/>
+ -->
<!--<module name="core-admin"/>-->
-
<!-- Module groups -->
-
<group name="portal">
<include
- modules="api, jems, server, security, search, format, portlet-server,
faces, theme, workflow, cms, registration, core, wsrp, core-admin, core-cms,
core-management, core-identity, core-samples, widget"/>
+ modules="api, jems, server, security, format, portlet-server, faces,
theme,registration, presentation, core, core-presentation, core-samples"/>
</group>
<group name="cms">
@@ -538,4 +556,4 @@
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
</target>
-</project>
\ No newline at end of file
+</project>
Modified:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralObjectImpl.java
===================================================================
---
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralObjectImpl.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralObjectImpl.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -58,6 +58,9 @@
public boolean compareTo(StructuralObject other)
{
- throw new NotYetImplemented();
+ /**sohil: this is causing issues while integrating ui interactions from the
browser. for now, return true until this function is properly implemented */
+ //throw new NotYetImplemented();
+
+ return true;
}
}
Modified:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateImpl.java
===================================================================
---
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateImpl.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateImpl.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -27,10 +27,12 @@
import org.jboss.portal.presentation.model.UIPortal;
import org.jboss.portal.presentation.model.UIPage;
import org.jboss.portal.presentation.model.UIWindow;
+import org.jboss.portal.presentation.model.UIContext;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.Context;
import java.util.Map;
@@ -81,8 +83,12 @@
{
Class<? extends UIObject> type = null;
- if(portalObject instanceof Portal)
+ if(portalObject instanceof Context)
{
+ type = UIContext.class;
+ }
+ else if(portalObject instanceof Portal)
+ {
type = UIPortal.class;
}
else if(portalObject instanceof Page)
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Portal.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Portal.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Portal.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -24,9 +24,9 @@
import com.google.gwt.core.client.EntryPoint;
-import org.jboss.portal.presentation.ajax.client.model.UIPage;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIPage;
import org.jboss.portal.presentation.ajax.client.protocol.Caller;
-import org.jboss.portal.presentation.ajax.client.protocol.ViewUIObjectAction;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxViewUIObjectAction;
/**
* This is the Entry Point of the client-side Ajax agent of the Presentation Framework
@@ -42,7 +42,7 @@
public void onModuleLoad()
{
//Load the default page of the default portal upon loading the user agent
- ViewUIObjectAction action = new ViewUIObjectAction("/default/default");
+ AjaxViewUIObjectAction action = new
AjaxViewUIObjectAction("/default/default");
action.execute(this);
}
@@ -51,9 +51,6 @@
*/
public void callback(Object result)
{
- if(result instanceof UIPage)
- {
- Util.displayPortalPage((UIPage)result);
- }
+ Util.displayPortalPage();
}
}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Session.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Session.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Session.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -22,8 +22,11 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.client;
-import org.jboss.portal.presentation.ajax.client.model.UIContext;
+import java.util.Map;
+import java.util.HashMap;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIContext;
+
/**
* This is the client side Session. This is a singleton since there should only be one
session for each client
*
@@ -38,17 +41,28 @@
private static Session singleton = null;
/**
+ * dataKeys
+ */
+ public static final String display = "display";
+
+ /**
*
*/
- private UIContext uiContext = null;
+ private AjaxUIContext uiContext = null;
/**
+ * @gwt.typeArgs <java.lang.String, java.lang.Object>
+ */
+ private Map attributes = null;
+
+ /**
*
*
*/
private Session()
{
- this.uiContext = new UIContext();
+ this.uiContext = new AjaxUIContext();
+ this.attributes = new HashMap();
}
/**
@@ -68,7 +82,7 @@
*
* @return
*/
- public UIContext getUiContext()
+ public AjaxUIContext getUiContext()
{
return this.uiContext;
}
@@ -77,8 +91,37 @@
*
* @param uiContext
*/
- public void setUiContext(UIContext uiContext)
+ public void setUiContext(AjaxUIContext uiContext)
{
this.uiContext = uiContext;
}
+
+ /**
+ *
+ * @param attributeKey
+ * @param value
+ */
+ public void setAttribute(String attributeKey, Object value)
+ {
+ this.attributes.put(attributeKey, value);
+ }
+
+ /**
+ *
+ * @param attributeKey
+ * @return
+ */
+ public Object getAttribute(String attributeKey)
+ {
+ return this.attributes.get(attributeKey);
+ }
+
+ /**
+ *
+ * @param attributeKey
+ */
+ public void removeAttribute(String attributeKey)
+ {
+ this.attributes.remove(attributeKey);
+ }
}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Util.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Util.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/Util.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -26,8 +26,8 @@
import java.util.List;
import org.jboss.portal.presentation.ajax.client.layout.LayoutManager;
-import org.jboss.portal.presentation.ajax.client.model.UIPage;
-import org.jboss.portal.presentation.ajax.client.model.UIWindow;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIPage;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIWindow;
import org.jboss.portal.presentation.ajax.client.widget.PortletWindow;
/**
@@ -40,23 +40,73 @@
*
* @param portalPage
*/
- public static void displayPortalPage(UIPage portalPage)
+ public static void displayPortalPage()
{
+ String portalPage = (String)Session.getInstance().getAttribute(Session.display);
+ Util.displayPortalPage(portalPage);
+ }
+
+ /**
+ *
+ * @param pageId
+ */
+ public static void displayPortalPage(String pageId)
+ {
+ AjaxUIPage portalPage =
(AjaxUIPage)Session.getInstance().getUiContext().getObject(pageId);
+
//Dispalying the fully aggregated page
List windows = portalPage.getChildren();
if(windows != null)
{
List displayWindows = new ArrayList();
- for(int i=0; i<windows.size(); i++)
+ AjaxUIWindow maximizedWindow = Util.getMaximizedWindow(portalPage);
+
+ if(maximizedWindow == null)
{
- UIWindow pageWindow = (UIWindow)windows.get(i);
- if(pageWindow.isVisible())
+ for(int i=0; i<windows.size(); i++)
{
- PortletWindow portletWindow = new PortletWindow(pageWindow);
- displayWindows.add(portletWindow);
+ AjaxUIWindow pageWindow = (AjaxUIWindow)windows.get(i);
+ if(pageWindow.isVisible())
+ {
+ PortletWindow portletWindow = new PortletWindow(pageWindow);
+ displayWindows.add(portletWindow);
+ }
}
}
+ else
+ {
+ PortletWindow portletWindow = new PortletWindow(maximizedWindow);
+ displayWindows.add(portletWindow);
+ }
+
+ //layout the page and its corresponding windows
LayoutManager.doLayout(displayWindows);
- }
+ }
}
+
+ /**
+ *
+ * @param portalPage
+ * @return
+ */
+ private static AjaxUIWindow getMaximizedWindow(AjaxUIPage portalPage)
+ {
+ AjaxUIWindow maximizedWindow = null;
+
+ List windows = portalPage.getChildren();
+ if(windows != null)
+ {
+ for(int i=0; i<windows.size(); i++)
+ {
+ AjaxUIWindow pageWindow = (AjaxUIWindow)windows.get(i);
+ if(pageWindow.getState().equals(AjaxUIWindow.MAXIMIZE))
+ {
+ maximizedWindow = pageWindow;
+ break;
+ }
+ }
+ }
+
+ return maximizedWindow;
+ }
}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/layout/LayoutManager.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/layout/LayoutManager.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/layout/LayoutManager.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -23,8 +23,13 @@
package org.jboss.portal.presentation.ajax.client.layout;
import java.util.List;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.HashMap;
+import java.util.ArrayList;
import com.google.gwt.user.client.ui.Widget;
+import net.mygwt.ui.client.widget.ContentPanel;
import net.mygwt.ui.client.widget.Viewport;
import net.mygwt.ui.client.widget.WidgetContainer;
@@ -64,7 +69,12 @@
*/
private static WidgetContainer center = null;
+ /**
+ *
+ */
+ private static Map pageCache = null;
+
/**
*
*/
@@ -88,6 +98,8 @@
BorderLayoutData northData = new BorderLayoutData(Style.NORTH, northSize);
northData.resizeable = true;
LayoutManager.viewport.add(LayoutManager.north, northData);
+
+ pageCache = new HashMap();
}
/**
@@ -99,19 +111,26 @@
LayoutManager.setUpPortletRegions();
int column = 0;
+ List westList = new ArrayList();
+ List centerList = new ArrayList();
+ LayoutManager.pageCache.put("west", westList);
+ LayoutManager.pageCache.put("center", centerList);
for(int i=0; i<displayWindows.size(); i++)
{
- PortletWindow portletWindow = (PortletWindow)displayWindows.get(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);
+ westList.add(portletWindow);
column ++;
}
else
{
- LayoutManager.center.add(window);
+ LayoutManager.center.add(window);
+ centerList.add(portletWindow);
column = 0;
}
}
@@ -120,16 +139,139 @@
/**
*
+ * @param widgetId
+ */
+ public static void maximize(String widgetId)
+ {
+ //Find the widget to be maximized
+ PortletWindow window = LayoutManager.findWindow(widgetId);
+
+ if(window != null)
+ {
+ //clear the layout grid
+ LayoutManager.setUpMaximizePortletRegions();
+
+ //Make this the only widget being displayed and *hide* the others
+ LayoutManager.center.add(window.create());
+
+ //refresh the layout
+ LayoutManager.viewport.layout(true);
+ }
+ }
+
+ /**
+ *
+ * @param widgetId
+ */
+ public static void minimize(String widgetId)
+ {
+ LayoutManager.normal(widgetId);
+ }
+
+ /**
+ *
+ * @param widgetId
+ */
+ public static void normal(String widgetId)
+ {
+ LayoutManager.setUpPortletRegions();
+
+ //restore west region
+ for(Iterator
itr=((ArrayList)LayoutManager.pageCache.get("west")).iterator();itr.hasNext();)
+ {
+ PortletWindow window = (PortletWindow)itr.next();
+ LayoutManager.west.add(window.create());
+ }
+
+ //restore center region
+ for(Iterator
itr=((ArrayList)LayoutManager.pageCache.get("center")).iterator();itr.hasNext();)
+ {
+ PortletWindow window = (PortletWindow)itr.next();
+ LayoutManager.center.add(window.create());
+ }
+
+ LayoutManager.viewport.layout(true);
+ }
+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ private static Widget find(String widgetId)
+ {
+ Widget widget = null;
+
+ //try to find it in the west region
+ for(int i=0; i<LayoutManager.west.getWidgetCount(); i++)
+ {
+ ContentPanel cour = (ContentPanel)LayoutManager.west.getWidget(i);
+ if(cour.getId().equals(widgetId))
+ {
+ widget = cour;
+ return widget;
+ }
+ }
+
+ //next try to find it in the center region
+ for(int i=0; i<LayoutManager.center.getWidgetCount(); i++)
+ {
+ ContentPanel cour = (ContentPanel)LayoutManager.center.getWidget(i);
+ if(cour.getId().equals(widgetId))
+ {
+ widget = cour;
+ return widget;
+ }
+ }
+
+ return widget;
+ }
+
+ private static PortletWindow findWindow(String windowId)
+ {
+ PortletWindow window = null;
+
+ List allWindows = new ArrayList();
+
+ List westWindows = (List)LayoutManager.pageCache.get("west");
+ if(westWindows != null)
+ {
+ allWindows.addAll(westWindows);
+ }
+
+ List centerWindows = (List)LayoutManager.pageCache.get("center");
+ if(centerWindows != null)
+ {
+ allWindows.addAll(centerWindows);
+ }
+
+ for(int i=0; i<allWindows.size(); i++)
+ {
+ PortletWindow cour = (PortletWindow)allWindows.get(i);
+
+ if(cour.getName().equals(windowId))
+ {
+ window = cour;
+ break;
+ }
+ }
+
+ return window;
+ }
+
+
+ /**
+ *
*
*/
private static void setUpPortletRegions()
{
if(LayoutManager.west != null)
{
+ LayoutManager.west.clear();
LayoutManager.viewport.remove(LayoutManager.west);
}
if(LayoutManager.center != null)
{
+ LayoutManager.center.clear();
LayoutManager.viewport.remove(LayoutManager.center);
}
@@ -161,4 +303,37 @@
centerData.resizeable = true;
LayoutManager.viewport.add(LayoutManager.center, centerData);
}
+
+ /**
+ *
+ *
+ */
+ private static void setUpMaximizePortletRegions()
+ {
+ if(LayoutManager.west != null)
+ {
+ LayoutManager.west.clear();
+ LayoutManager.viewport.remove(LayoutManager.west);
+ }
+ if(LayoutManager.center != null)
+ {
+ LayoutManager.center.clear();
+ LayoutManager.viewport.remove(LayoutManager.center);
+ }
+
+ //Re-add these two regions
+ //Layout for the center region (Portlet Windows are laid out here)
+ FlowLayout centerLayout = new FlowLayout();
+ centerLayout.spacing = 5;
+ centerLayout.margin = 5;
+
+
+ //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);
+ }
}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIContainer.java
(from rev 9408,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContainer.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIContainer.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIContainer.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.model;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public final class AjaxUIContainer extends AjaxUIObject
+{
+
+}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIContext.java
(from rev 9408,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContext.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIContext.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIContext.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.model;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public final class AjaxUIContext extends AjaxUIObject
+{
+ /**
+ * @gwt.typeArgs <java.lang.String,
org.jboss.portal.presentation.ajax.client.model.AjaxUIObject>
+ */
+ private Map objectTree = new HashMap();
+
+ /**
+ *
+ * @param id
+ * @return
+ */
+ public AjaxUIObject getObject(String id)
+ {
+ AjaxUIObject object = null;
+
+ if(this.objectTree.containsKey(id))
+ {
+ object = (AjaxUIObject)this.objectTree.get(id);
+ }
+
+ return object;
+ }
+
+ /**
+ *
+ * @param id
+ */
+ public void addObject(AjaxUIObject object)
+ {
+ object.setContext(this);
+ this.objectTree.put(object.getId(), object);
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Map getObjectTree()
+ {
+ return objectTree;
+ }
+
+ /**
+ *
+ * @param objectTree
+ */
+ public void setObjectTree(Map objectTree)
+ {
+ this.objectTree = objectTree;
+ }
+}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIObject.java
(from rev 9408,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIObject.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIObject.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIObject.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,172 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.model;
+
+import java.util.List;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public abstract class AjaxUIObject implements IsSerializable
+{
+ /**
+ *
+ */
+ public static final int STATUS_VALID = 0;
+ public static final int STATUS_INVALID = 1;
+ public static final int STATUS_STALE = 2;
+
+ /**
+ *
+ */
+ protected String id = null;
+
+ /**
+ *
+ */
+ protected int status = STATUS_VALID;
+
+ /**
+ *
+ */
+ protected AjaxUIObject parent = null;
+
+ /**
+ * @gwt.typeArgs <org.jboss.portal.presentation.ajax.client.model.AjaxUIObject>
+ */
+ protected List children = null;
+
+ /**
+ *
+ */
+ protected AjaxUIContext context = null;
+
//----------------------------------------------------------------------------------------------------------------------------------------------------------
+
+ /**
+ *
+ * @return
+ */
+ public String getId()
+ {
+ return this.id;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getName()
+ {
+ int lastIndex = id.lastIndexOf("/");
+ return id.substring(lastIndex+1);
+ }
+
+ /**
+ *
+ * @return
+ */
+ public int getStatus()
+ {
+ return this.status;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public AjaxUIObject getParent()
+ {
+ return this.parent;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public List getChildren()
+ {
+ return this.children;
+ }
+
+ /**
+ *
+ * @param name
+ * @return
+ */
+ public AjaxUIObject getChild(String name)
+ {
+ AjaxUIObject child = null;
+
+ if(this.children != null)
+ {
+ for(int i=0; i<this.children.size(); i++)
+ {
+ AjaxUIObject cour = (AjaxUIObject)this.children.get(i);
+ if(cour.getName().equals(name))
+ {
+ child = cour;
+ break;
+ }
+ }
+ }
+
+ return child;
+ }
+
+ public AjaxUIContext getContext()
+ {
+ return context;
+ }
+
+ public void setContext(AjaxUIContext context)
+ {
+ this.context = context;
+ }
+
+ /**
+ *
+ * @param children
+ */
+ public void setChildren(List children)
+ {
+ this.children = children;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public void setParent(AjaxUIObject parent)
+ {
+ this.parent = parent;
+ }
+
+ public void setStatus(int status)
+ {
+ this.status = status;
+ }
+}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIPage.java
(from rev 9408,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPage.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIPage.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIPage.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.model;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public final class AjaxUIPage extends AjaxUIObject
+{
+}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIPortal.java
(from rev 9408,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPortal.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIPortal.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIPortal.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.model;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public final class AjaxUIPortal extends AjaxUIObject
+{
+
+}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIWindow.java
(from rev 9408,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIWindow.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIWindow.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/AjaxUIWindow.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,117 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.model;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public final class AjaxUIWindow extends AjaxUIObject
+{
+ public static final String NORMAL = "normal";
+ public static final String MAXIMIZE = "maximized";
+ public static final String MINIMIZE = "minimized";
+ public static final String EDIT = "edit";
+ public static final String VIEW = "view";
+
+ private String content = null;
+ private String mode = VIEW;
+ private String state = NORMAL;
+ private boolean isVisible = true;
+
+
+ /**
+ *
+ * @return
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ *
+ * @param content
+ */
+ public void setContent(String content)
+ {
+ this.content = content;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public boolean isVisible()
+ {
+ return isVisible;
+ }
+
+ /**
+ *
+ * @param isVisible
+ */
+ public void setVisible(boolean isVisible)
+ {
+ this.isVisible = isVisible;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getMode()
+ {
+ return mode;
+ }
+
+ /**
+ *
+ * @param mode
+ */
+ public void setMode(String mode)
+ {
+ this.mode = mode;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public String getState()
+ {
+ return state;
+ }
+
+ /**
+ *
+ * @param state
+ */
+ public void setState(String state)
+ {
+ this.state = state;
+ }
+}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContainer.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContainer.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContainer.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -1,32 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.presentation.ajax.client.model;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public final class UIContainer extends UIObject
-{
-
-}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContext.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContext.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIContext.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -1,83 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.presentation.ajax.client.model;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public final class UIContext extends UIObject
-{
- /**
- * @gwt.typeArgs <java.lang.String,
org.jboss.portal.presentation.ajax.client.model.UIObject>
- */
- private Map objectTree = new HashMap();
-
- /**
- *
- * @param id
- * @return
- */
- public UIObject getObject(String id)
- {
- UIObject object = null;
-
- if(this.objectTree.containsKey(id))
- {
- object = (UIObject)this.objectTree.get(id);
- }
-
- return object;
- }
-
- /**
- *
- * @param id
- */
- public void addObject(UIObject object)
- {
- object.setContext(this);
- this.objectTree.put(object.getId(), object);
- }
-
- /**
- *
- * @return
- */
- public Map getObjectTree()
- {
- return objectTree;
- }
-
- /**
- *
- * @param objectTree
- */
- public void setObjectTree(Map objectTree)
- {
- this.objectTree = objectTree;
- }
-}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIObject.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIObject.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIObject.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -1,181 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.presentation.ajax.client.model;
-
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public abstract class UIObject implements IsSerializable
-{
- /**
- *
- */
- public static final int STATUS_VALID = 0;
- public static final int STATUS_INVALID = 1;
- public static final int STATUS_STALE = 2;
-
- /**
- *
- */
- protected String id = null;
-
- /**
- *
- */
- protected String name = null;
-
- /**
- *
- */
- protected int status = STATUS_VALID;
-
- /**
- *
- */
- protected UIObject parent = null;
-
- /**
- * @gwt.typeArgs <org.jboss.portal.presentation.ajax.client.model.UIObject>
- */
- protected List children = null;
-
- /**
- *
- */
- protected UIContext context = null;
-
//----------------------------------------------------------------------------------------------------------------------------------------------------------
-
- /**
- *
- * @return
- */
- public String getId()
- {
- return this.id;
- }
-
- /**
- *
- * @return
- */
- public String getName()
- {
- return this.name;
- }
-
- /**
- *
- * @return
- */
- public int getStatus()
- {
- return this.status;
- }
-
- /**
- *
- * @return
- */
- public UIObject getParent()
- {
- return this.parent;
- }
-
- /**
- *
- * @return
- */
- public List getChildren()
- {
- return this.children;
- }
-
- /**
- *
- * @param name
- * @return
- */
- public UIObject getChild(String name)
- {
- UIObject child = null;
-
- if(this.children != null)
- {
- for(int i=0; i<this.children.size(); i++)
- {
- UIObject cour = (UIObject)this.children.get(i);
- if(cour.getName().equals(name))
- {
- child = cour;
- break;
- }
- }
- }
-
- return child;
- }
-
- public UIContext getContext()
- {
- return context;
- }
-
- public void setContext(UIContext context)
- {
- this.context = context;
- }
-
- /**
- *
- * @param children
- */
- public void setChildren(List children)
- {
- this.children = children;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public void setParent(UIObject parent)
- {
- this.parent = parent;
- }
-
- public void setStatus(int status)
- {
- this.status = status;
- }
-}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPage.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPage.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPage.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -1,33 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.presentation.ajax.client.model;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public final class UIPage extends UIObject
-{
-}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPortal.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPortal.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIPortal.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -1,32 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.presentation.ajax.client.model;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public final class UIPortal extends UIObject
-{
-
-}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIWindow.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIWindow.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/model/UIWindow.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -1,117 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.presentation.ajax.client.model;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public final class UIWindow extends UIObject
-{
- public static final String NORMAL = "NORMAL";
- public static final String MAXIMIZED = "MAXIMIZED";
- public static final String MINIMIZED = "MINIMIZED";
- public static final String EDIT = "EDIT";
- public static final String VIEW = "VIEW";
-
- private String content = null;
- private String mode = VIEW;
- private String state = NORMAL;
- private boolean isVisible = true;
-
-
- /**
- *
- * @return
- */
- public String getContent()
- {
- return content;
- }
-
- /**
- *
- * @param content
- */
- public void setContent(String content)
- {
- this.content = content;
- }
-
- /**
- *
- * @return
- */
- public boolean isVisible()
- {
- return isVisible;
- }
-
- /**
- *
- * @param isVisible
- */
- public void setVisible(boolean isVisible)
- {
- this.isVisible = isVisible;
- }
-
- /**
- *
- * @return
- */
- public String getMode()
- {
- return mode;
- }
-
- /**
- *
- * @param mode
- */
- public void setMode(String mode)
- {
- this.mode = mode;
- }
-
-
- /**
- *
- * @return
- */
- public String getState()
- {
- return state;
- }
-
- /**
- *
- * @param state
- */
- public void setState(String state)
- {
- this.state = state;
- }
-}
Added:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxShowUIObjectResponse.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxShowUIObjectResponse.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxShowUIObjectResponse.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.protocol;
+
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIObject;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class AjaxShowUIObjectResponse extends ClientResponse
+{
+ /**
+ *
+ */
+ private AjaxUIObject uiObject = null;
+
+ /**
+ *
+ *
+ */
+ public AjaxShowUIObjectResponse()
+ {
+
+ }
+
+ /**
+ *
+ * @param uiObject
+ */
+ public AjaxShowUIObjectResponse(AjaxUIObject uiObject)
+ {
+ this.uiObject = uiObject;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public AjaxUIObject getUiObject()
+ {
+ return uiObject;
+ }
+
+ /**
+ *
+ * @param uiObject
+ */
+ public void setUiObject(AjaxUIObject uiObject)
+ {
+ this.uiObject = uiObject;
+ }
+
+}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxUIObjectAction.java
(from rev 9408,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/UIObjectAction.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxUIObjectAction.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxUIObjectAction.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.protocol;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public abstract class AjaxUIObjectAction extends ClientAction
+{
+ /**
+ *
+ */
+ private final String targetId;
+
+ /**
+ *
+ * @param targetId
+ */
+ public AjaxUIObjectAction(String targetId)
+ {
+ this.targetId = targetId;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getTargetId()
+ {
+ return targetId;
+ }
+}
Added:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxUpdateWindowStateAction.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxUpdateWindowStateAction.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxUpdateWindowStateAction.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.ajax.client.protocol;
+
+import org.jboss.portal.presentation.ajax.client.Session;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIObject;
+import org.jboss.portal.presentation.ajax.client.service.PortalRPC;
+import org.jboss.portal.presentation.ajax.client.service.PortalRPCAsync;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class AjaxUpdateWindowStateAction extends AjaxUIObjectAction
+{
+ /**
+ *
+ */
+ private String windowState = null;
+
+ /**
+ *
+ * @param targetId
+ */
+ public AjaxUpdateWindowStateAction(String windowId, String windowState)
+ {
+ super(windowId);
+ this.windowState = windowState;
+ }
+
+ /**
+ *
+ */
+ public void execute(final Caller caller)
+ {
+ PortalRPCAsync portalRPC = (PortalRPCAsync)GWT.create(PortalRPC.class);
+
((ServiceDefTarget)portalRPC).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
+ AsyncCallback callback = new AsyncCallback()
+ {
+ public void onSuccess(Object result)
+ {
+ if(result instanceof AjaxShowUIObjectResponse)
+ {
+ AjaxUIObject uiObject = ((AjaxShowUIObjectResponse)result).getUiObject();
+ Session.getInstance().getUiContext().addObject(uiObject);
+ caller.callback(uiObject);
+ }
+ }
+
+ public void onFailure(Throwable caught)
+ {
+ /**
+ * TODO: Handle exception properly
+ */
+ }
+ };
+ Map queryParams = new HashMap();
+ queryParams.put("windowstate", this.windowState);
+ portalRPC.asyncGet(this.getTargetId(), queryParams, callback);
+ }
+}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxViewUIObjectAction.java
(from rev 9408,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ViewUIObjectAction.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxViewUIObjectAction.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/AjaxViewUIObjectAction.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.protocol;
+
+import org.jboss.portal.presentation.ajax.client.Session;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIObject;
+import org.jboss.portal.presentation.ajax.client.service.PortalRPC;
+import org.jboss.portal.presentation.ajax.client.service.PortalRPCAsync;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class AjaxViewUIObjectAction extends AjaxUIObjectAction
+{
+ /**
+ *
+ * @param targetId
+ */
+ public AjaxViewUIObjectAction(String targetId)
+ {
+ super(targetId);
+ }
+
+ /**
+ *
+ */
+ public void execute(final Caller caller)
+ {
+ PortalRPCAsync portalRPC = (PortalRPCAsync)GWT.create(PortalRPC.class);
+
((ServiceDefTarget)portalRPC).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
+ AsyncCallback callback = new AsyncCallback()
+ {
+ public void onSuccess(Object result)
+ {
+ AjaxUIObject uiObject = ((AjaxShowUIObjectResponse)result).getUiObject();
+ Session.getInstance().getUiContext().addObject(uiObject);
+ Session.getInstance().setAttribute(Session.display, uiObject.getId());
+ caller.callback(null);
+ }
+
+ public void onFailure(Throwable caught)
+ {
+ /**
+ * TODO: Handle exception properly
+ */
+ }
+ };
+ portalRPC.loadObject(this.getTargetId(), callback);
+ }
+}
Added:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ClientResponse.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ClientResponse.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ClientResponse.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.protocol;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public abstract class ClientResponse implements IsSerializable
+{
+
+}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/UIObjectAction.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/UIObjectAction.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/UIObjectAction.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -1,53 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.presentation.ajax.client.protocol;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public abstract class UIObjectAction extends ClientAction
-{
- /**
- *
- */
- private final String targetId;
-
- /**
- *
- * @param targetId
- */
- public UIObjectAction(String targetId)
- {
- this.targetId = targetId;
- }
-
- /**
- *
- * @return
- */
- public String getTargetId()
- {
- return targetId;
- }
-}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ViewUIObjectAction.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ViewUIObjectAction.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/protocol/ViewUIObjectAction.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -1,71 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.presentation.ajax.client.protocol;
-
-import org.jboss.portal.presentation.ajax.client.Session;
-import org.jboss.portal.presentation.ajax.client.model.UIObject;
-import org.jboss.portal.presentation.ajax.client.service.PortalRPC;
-import org.jboss.portal.presentation.ajax.client.service.PortalRPCAsync;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class ViewUIObjectAction extends UIObjectAction
-{
- /**
- *
- * @param targetId
- */
- public ViewUIObjectAction(String targetId)
- {
- super(targetId);
- }
-
- /**
- *
- */
- public void execute(final Caller caller)
- {
- PortalRPCAsync portalRPC = (PortalRPCAsync)GWT.create(PortalRPC.class);
-
((ServiceDefTarget)portalRPC).setServiceEntryPoint(GWT.getModuleBaseURL()+"/portalrpc");
- AsyncCallback callback = new AsyncCallback()
- {
- public void onSuccess(Object result)
- {
- UIObject uiObject = (UIObject)result;
- Session.getInstance().getUiContext().addObject(uiObject);
- caller.callback(uiObject);
- }
-
- public void onFailure(Throwable caught)
- {
- }
- };
- portalRPC.loadObject(this.getTargetId(), callback);
- }
-}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/service/PortalRPC.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/service/PortalRPC.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/service/PortalRPC.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -22,9 +22,10 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.client.service;
+import java.util.Map;
import com.google.gwt.user.client.rpc.RemoteService;
-import org.jboss.portal.presentation.ajax.client.model.UIObject;
+import org.jboss.portal.presentation.ajax.client.protocol.ClientResponse;
/**
* RPC service used for Asynchronous communication between the client-side agent and the
Portal Server
@@ -39,5 +40,14 @@
*
* @return
*/
- public UIObject loadObject(String objectId);
+ public ClientResponse loadObject(String objectId);
+
+ /**
+ * Asynchronously changes the window state of the specified window on the server
+ *
+ * @param url
+ * @gwt.typeArgs queryParams <java.lang.String, java.lang.String>
+ * @return
+ */
+ public ClientResponse asyncGet(String url, Map queryParams);
}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/service/PortalRPCAsync.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/service/PortalRPCAsync.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/service/PortalRPCAsync.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.client.service;
+import java.util.Map;
+
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
@@ -36,4 +38,13 @@
* Asynchronously loads the specified object from the server
*/
public void loadObject(String objectId, AsyncCallback callback);
+
+ /**
+ * Asynchronously changes the window state of the specified window on the server
+ *
+ * @param url
+ * @gwt.typeArgs queryParams <java.lang.String, java.lang.String>
+ * @param callback
+ */
+ public void asyncGet(String url, Map queryParams, AsyncCallback callback);
}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/widget/PortletWindow.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/widget/PortletWindow.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/ajax/client/widget/PortletWindow.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -47,24 +47,31 @@
import net.mygwt.ui.client.event.Listener;
import net.mygwt.ui.client.event.BaseEvent;
-import org.jboss.portal.presentation.ajax.client.model.UIWindow;
+import org.jboss.portal.presentation.ajax.client.Util;
+import org.jboss.portal.presentation.ajax.client.Session;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIWindow;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIPage;
+import org.jboss.portal.presentation.ajax.client.layout.LayoutManager;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxUpdateWindowStateAction;
+import org.jboss.portal.presentation.ajax.client.protocol.Caller;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
-public class PortletWindow
+public class PortletWindow implements Caller
{
/**
*
*/
- private UIWindow window = null;
+ private AjaxUIWindow window = null;
+ private String newWindowState = null;
/**
*
*
*/
- public PortletWindow(UIWindow window)
+ public PortletWindow(AjaxUIWindow window)
{
this.window = window;
}
@@ -73,74 +80,75 @@
*
* @return
*/
+ public String getName()
+ {
+ return this.window.getName();
+ }
+
+ /**
+ *
+ * @return
+ */
public ContentPanel create()
- {
- ContentPanel portletWindow = new ContentPanel(Style.HEADER);
- String windowName = this.window.getName();
- String content = this.window.getContent();
+ {
+ String windowName = this.getName();
+
+ 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);
- 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....");
- }
- }
- };
+ //Normal, Maximized, Minimized
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.setId(windowName+":"+AjaxUIWindow.NORMAL);
restore.setToolTip("Normal");
+
IconButton minimize = new IconButton("my-tool-minimize");
- minimize.setId(windowName+":minimize");
+ minimize.setId(windowName+":"+AjaxUIWindow.MINIMIZE);
minimize.setToolTip("Minimize");
+
IconButton maximize = new IconButton("my-tool-maximize");
- maximize.setId(windowName+":maximize");
+ maximize.setId(windowName+":"+AjaxUIWindow.MAXIMIZE);
maximize.setToolTip("Maximize");
+
+ //Setup the buttons
+ Listener listener = new PortletWindowListener(this);
+
portletWindow.addButton(save, listener);
- portletWindow.addButton(help, listener);
- portletWindow.addButton(restore, listener);
- portletWindow.addButton(minimize, listener);
- portletWindow.addButton(maximize, listener);
+ portletWindow.addButton(help, listener);
+ if(this.window.getState().equals(AjaxUIWindow.NORMAL) ||
this.window.getState().equals(AjaxUIWindow.MAXIMIZE))
+ {
+ portletWindow.addButton(minimize, listener);
+ }
+
+ if(this.window.getState().equals(AjaxUIWindow.MAXIMIZE) ||
this.window.getState().equals(AjaxUIWindow.MINIMIZE))
+ {
+ portletWindow.addButton(restore, listener);
+ }
+
+ if(this.window.getState().equals(AjaxUIWindow.NORMAL) ||
this.window.getState().equals(AjaxUIWindow.MINIMIZE))
+ {
+ portletWindow.addButton(maximize, listener);
+ }
+
+ //Add the content
+ if(!this.window.getState().equals(AjaxUIWindow.MINIMIZE))
+ {
+ HTML windowContent = new HTML(this.window.getContent());
+ portletWindow.add(windowContent);
+ }
+
+ return portletWindow;
+
//Event Listener for actions perfomed inside the portlet window content
//itself. Used for performing Partial Refresh of a Portal Page
/*ClickListener contentListener = new ClickListener()
@@ -184,13 +192,139 @@
}
}
};
- windowContent.addClickListener(contentListener);*/
+ windowContent.addClickListener(contentListener);*/
+ }
+
+ /**
+ *
+ */
+ public void callback(Object result)
+ {
+ if(result instanceof AjaxUIPage)
+ {
+ boolean valid = this.validateNewWindowState();
+ if(valid)
+ {
+ this.refresh();
+ if(this.newWindowState.equals(AjaxUIWindow.NORMAL))
+ {
+ LayoutManager.normal(this.getName());
+ }
+ else if(this.newWindowState.equals(AjaxUIWindow.MAXIMIZE))
+ {
+ LayoutManager.maximize(this.getName());
+ }
+ else if(this.newWindowState.equals(AjaxUIWindow.MINIMIZE))
+ {
+ LayoutManager.minimize(this.getName());
+ }
+ }
+ else
+ {
+ //Do something to handle this situation in a user-friendly manner
+ //Probably just laying out the current state of the page
+ Util.displayPortalPage();
+ }
+ }
- //Add the content
- portletWindow.add(windowContent);
+ //local state cleanup
+ this.newWindowState = null;
+ }
+
+ /**
+ *
+ *
+ */
+ private boolean validateNewWindowState()
+ {
+ boolean valid = false;
- return portletWindow;
- }
+ String display = (String)Session.getInstance().getAttribute(Session.display);
+ AjaxUIPage displayedPage =
(AjaxUIPage)Session.getInstance().getUiContext().getObject(display);
+
+ AjaxUIWindow childWindow = (AjaxUIWindow)displayedPage.getChild(this.getName());
+
+ if(childWindow != null &&
childWindow.getState().equals(this.newWindowState))
+ {
+ valid = true;
+ }
+
+ return valid;
+ }
+
+ /**
+ *
+ *
+ */
+ private void refresh()
+ {
+ String display = (String)Session.getInstance().getAttribute(Session.display);
+ AjaxUIPage displayedPage =
(AjaxUIPage)Session.getInstance().getUiContext().getObject(display);
+
+ this.window = (AjaxUIWindow)displayedPage.getChild(this.getName());
+ }
+
+ /**
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+ private class PortletWindowListener implements Listener
+ {
+ /**
+ *
+ */
+ private PortletWindow portletWindow = null;
+
+ /**
+ *
+ * @param portletWindow
+ */
+ private PortletWindowListener(PortletWindow portletWindow)
+ {
+ this.portletWindow = portletWindow;
+ }
+
+ /**
+ *
+ * @param event
+ */
+ 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);
+
+ //Process the action performed on the window
+ if(action.equals(AjaxUIWindow.NORMAL))
+ {
+ AjaxUpdateWindowStateAction stateAction = new
AjaxUpdateWindowStateAction(this.portletWindow.window.getId(), AjaxUIWindow.NORMAL);
+ newWindowState = AjaxUIWindow.NORMAL;
+ stateAction.execute(this.portletWindow);
+ }
+ else if(action.equals(AjaxUIWindow.MAXIMIZE))
+ {
+ AjaxUpdateWindowStateAction stateAction = new
AjaxUpdateWindowStateAction(this.portletWindow.window.getId(), AjaxUIWindow.MAXIMIZE);
+ newWindowState = AjaxUIWindow.MAXIMIZE;
+ stateAction.execute(this.portletWindow);
+ }
+ else if(action.equals(AjaxUIWindow.MINIMIZE))
+ {
+ AjaxUpdateWindowStateAction stateAction = new
AjaxUpdateWindowStateAction(this.portletWindow.window.getId(), AjaxUIWindow.MINIMIZE);
+ newWindowState = AjaxUIWindow.MINIMIZE;
+ stateAction.execute(this.portletWindow);
+ }
+ else if(action.equals("save"))
+ {
+ Info.show("Save", "Loading Save Mode....", "Loading
Save Mode....");
+ }
+ else if(action.equals("help"))
+ {
+ Info.show("Help", "Loading Help Mode....", "Loading
Help Mode....");
+ }
+ }
+ }
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
/**
*
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/AjaxUIController.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/AjaxUIController.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/AjaxUIController.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -145,9 +145,8 @@
{
UIPage page = (UIPage)uiObject;
- org.jboss.portal.presentation.ajax.client.model.UIPage clientPage = new
org.jboss.portal.presentation.ajax.client.model.UIPage();
- clientPage.setId(page.getId());
- clientPage.setName(page.getName());
+ org.jboss.portal.presentation.ajax.client.model.AjaxUIPage clientPage = new
org.jboss.portal.presentation.ajax.client.model.AjaxUIPage();
+ clientPage.setId(page.getId());
//TODO: set proper status
//TODO: set proper parent reference
@@ -162,12 +161,11 @@
{
WindowContent windowContent =
this.presentationServer.render(presentationContext, window);
- org.jboss.portal.presentation.ajax.client.model.UIWindow clientWindow
= new org.jboss.portal.presentation.ajax.client.model.UIWindow();
+ org.jboss.portal.presentation.ajax.client.model.AjaxUIWindow
clientWindow = new org.jboss.portal.presentation.ajax.client.model.AjaxUIWindow();
- clientWindow.setId(window.getId());
- clientWindow.setName(windowContent.getTitle());
+ clientWindow.setId(window.getId());
clientWindow.setParent(clientPage);
- //TODO: set proper status
+ //TODO: Set proper status
clientWindow.setContent(windowContent.getMarkup());
if(window.getMode() != null)
@@ -177,8 +175,7 @@
if(window.getWindowState() != null)
{
clientWindow.setState(window.getWindowState().toString());
- }
- //TODO: set proper visibility status
+ }
clientWindows.add(clientWindow);
}
@@ -188,6 +185,7 @@
}
}
}
+
clientPage.setChildren(clientWindows);
invocation.getServerContext().getClientRequest().setAttribute("uiObject",
clientPage);
@@ -234,11 +232,20 @@
*/
private ServerAction getServerAction(PresentationContext presentationContext,
ServerInvocation invocation)
{
+ ServerAction action = null;
+ //Process any window state change incoming requests
+ action =
(ServerAction)invocation.getServerContext().getClientRequest().getAttribute("serverAction");
+
//Just use ViewUIObject command for now until URL interpretation/mapping
//to ServiceAction is implemented
- return new ViewUIObjectAction("/default/default");
+ if(action == null)
+ {
+ action = new ViewUIObjectAction("/default/default");
+ }
+
+ return action;
/*ServerInvocationContext invocationContext = invocation.getServerContext();
String requestPath = invocation.getServerContext().getPortalRequestPath();
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/ajax/entry/PortalEntryPoint.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/ajax/entry/PortalEntryPoint.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/ajax/entry/PortalEntryPoint.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -31,13 +31,16 @@
import org.jboss.portal.web.WebRequest;
import org.jboss.portal.presentation.ajax.client.service.PortalRPC;
-import org.jboss.portal.presentation.ajax.client.model.UIObject;
-import org.jboss.portal.presentation.ajax.client.model.UIPage;
-import org.jboss.portal.presentation.ajax.client.model.UIContext;
-import org.jboss.portal.presentation.ajax.client.model.UIPortal;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIObject;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIPage;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIContext;
+import org.jboss.portal.presentation.ajax.client.model.AjaxUIPortal;
import org.jboss.portal.presentation.ajax.client.model.Page;
import org.jboss.portal.presentation.ajax.client.model.Window;
+import org.jboss.portal.presentation.ajax.client.protocol.ClientResponse;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxShowUIObjectResponse;
import org.jboss.portal.presentation.server.ProcessorResponse;
+import org.jboss.portal.presentation.protocol.GetActivation;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
@@ -120,11 +123,11 @@
*
* @return The Initial Portal Page
*/
- public UIObject loadObject(String objectId)
+ public ClientResponse loadObject(String objectId)
{
try
{
- UIObject uiObject = null;
+ AjaxUIObject uiObject = null;
HttpServletRequest request = this.getThreadLocalRequest();
@@ -132,15 +135,56 @@
this.callPortalServer();
//Setup the initial UIContext for the client session
- uiObject = (UIObject)request.getAttribute("uiObject");
+ uiObject = (AjaxUIObject)request.getAttribute("uiObject");
- return uiObject;
+ return new AjaxShowUIObjectResponse(uiObject);
}
catch(Exception e)
{
throw new RuntimeException(e);
}
- }
+ }
+
+ /**
+ *
+ * @param objectId
+ * @param windowState
+ * @return
+ */
+ public ClientResponse asyncGet(String url, Map queryParams)
+ {
+ try
+ {
+ ClientResponse clientResponse = null;
+
+ HttpServletRequest request = this.getThreadLocalRequest();
+
+ if(queryParams.containsKey("windowstate"))
+ {
+ String windowState = (String)queryParams.get("windowstate");
+ queryParams.put("windowstate", new String[]{windowState});
+ }
+ GetActivation get = new GetActivation(url, queryParams);
+
+ request.setAttribute("serverAction", get);
+
+ //execute the call on the Portal
+ this.callPortalServer();
+
+ //Setup the initial UIContext for the client session
+ AjaxUIObject uiObject =
(AjaxUIObject)request.getAttribute("uiObject");
+ if(uiObject != null)
+ {
+ clientResponse = new AjaxShowUIObjectResponse(uiObject);
+ }
+
+ return clientResponse;
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------
/**
*
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/ObjectContext.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/ObjectContext.java 2008-01-03
00:21:34 UTC (rev 9420)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/ObjectContext.java 2008-01-03
06:51:22 UTC (rev 9421)
@@ -59,6 +59,9 @@
/** The status related to the structural object value. */
UIObject.Status status;
+
+ /** */
+ AssociationContext associationContext;
ObjectContext(
UIObjectContainer container,