JBoss Portal SVN: r9427 - branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-01-03 11:49:45 -0500 (Thu, 03 Jan 2008)
New Revision: 9427
Removed:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/AssociationContext.java
Log:
deleting AssociationContext from codebase
Deleted: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/AssociationContext.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/AssociationContext.java 2008-01-03 13:51:51 UTC (rev 9426)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/AssociationContext.java 2008-01-03 16:49:45 UTC (rev 9427)
@@ -1,568 +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.impl.model.container;
-
-import org.jboss.portal.presentation.impl.model.container.spi.UIContainerObject;
-import org.jboss.portal.presentation.model.state.structural.StructuralObject;
-import org.jboss.portal.presentation.model.state.StateException;
-import org.jboss.portal.presentation.model.UIObject;
-
-import java.util.Iterator;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Collection;
-import java.util.AbstractSet;
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-final class AssociationContext
-{
-
- /** . */
- ObjectContext owner;
-
- /** . */
- final ManyToOne parent = new ManyToOne()
- {
- protected StructuralObject doLoad()
- {
- return owner.container.structuralStateContext.loadParent(owner.structuralObject);
- }
- protected ObjectContext getOwner()
- {
- return owner;
- }
- protected OneToMany getOneToMany(UIContainerObject related)
- {
- return ((ObjectContext)related.getContext()).associationContext.children;
- }
- };
-
- /** . */
- final OneToMany children = new OneToMany()
- {
- protected Collection<StructuralObject> doLoad()
- {
- return owner.container.structuralStateContext.loadChildren(owner.structuralObject);
- }
- protected ObjectContext getOwner()
- {
- return owner;
- }
- protected ManyToOne getManyToOne(UIContainerObject related)
- {
- return ((ObjectContext)related.getContext()).associationContext.parent;
- }
- };
-
- static abstract class ManyToOne
- {
-
- /** . */
- private boolean loaded;
-
- /** . */
- private UIContainerObject related;
-
- /** The context pointing at us via a OneToMany. */
- private Set<ObjectContext> refs;
-
- private ManyToOne()
- {
- this.loaded = false;
- this.related = null;
- this.refs = new HashSet<ObjectContext>();
- }
-
- Set<ObjectContext> getReferences()
- {
- return refs;
- }
-
- boolean isLoaded()
- {
- return loaded;
- }
-
- void setLoadedRelated(UIContainerObject newParent)
- {
- if (newParent == null)
- {
- throw new IllegalArgumentException();
- }
- if (!loaded)
- {
- throw new IllegalStateException("Cannot set parent of non loaded association");
- }
-
- // Downgrade the related side
- if (related != null)
- {
- detach();
- }
-
- //
- if (newParent != null)
- {
- attach(newParent);
- }
- else
- {
- related = null;
- loaded = false;
- }
- }
-
- UIContainerObject getLoadedRelated()
- {
- if (!loaded)
- {
- throw new IllegalStateException("Cannot set parent of non loaded association");
- }
- return related;
- }
-
- void clearLoadedRelated()
- {
- if (!loaded)
- {
- throw new IllegalStateException("Cannot clear parent of non loaded association");
- }
-
- // Downgrade realted
- detach();
-
- //
- loaded = false;
- }
-
- UIContainerObject getRelated()
- {
- ObjectContext owner = getOwner();
-
- //
- owner.checkAccess();
-
- //
- if (!loaded)
- {
- load();
- }
-
- //
- owner.checkAccess();
-
- //
- return related;
- }
-
- /**
- * Loads the related side.
- *
- * @return the loaded structural object
- * @throws StateException if the load operation cannot be achieved
- */
- protected abstract StructuralObject doLoad() throws StateException;
-
- protected abstract ObjectContext getOwner();
-
- protected abstract OneToMany getOneToMany(UIContainerObject related);
-
- private void attach(UIContainerObject related)
- {
- if (this.related != null)
- {
- throw new AssertionError("BUG");
- }
-
- //
- OneToMany oneToMany = getOneToMany(related);
- ObjectContext owner = getOwner();
-
- //
- if (oneToMany.refs.contains(owner))
- {
- throw new AssertionError("BUG");
- }
-
- //
- oneToMany.refs.add(owner);
- this.related = related;
- }
-
- private void detach()
- {
- if (related == null)
- {
- throw new AssertionError("BUG");
- }
-
- //
- OneToMany oneToMany = getOneToMany(related);
- ObjectContext owner = getOwner();
-
- //
- if (!oneToMany.refs.contains(owner))
- {
- throw new AssertionError("BUG");
- }
-
- //
- oneToMany.refs.remove(owner);
- this.related = null;
- }
-
- /**
- * Attempt for loading the related side. If a failure occurs during while loading the related side
- * the load operation is aborted and the status of the association owner is updated accordingly. If the loading
- * of the related side is succesful the association is updated.
- */
- private void load()
- {
- ObjectContext owner = getOwner();
-
- //
- try
- {
- StructuralObject relatedSO = doLoad();
-
- // If null it is the root so nothing is done
- if (relatedSO != null)
- {
- UIContainerObject related = owner.container.get(relatedSO);
-
- //
- if (related != null)
- {
- attach(related);
-
- //
- ObjectContext parentContext = (ObjectContext)related.getContext();
-
- //
- if (!relatedSO.compareTo(parentContext.structuralObject))
- {
- parentContext.status = UIObject.Status.STALE;
- }
- }
- else
- {
- related = owner.container.create(relatedSO);
-
- //
- owner.container.attach(related);
-
- //
- attach(related);
- }
- }
-
- // Set as loaded
- this.loaded = true;
- }
- catch (StateException e)
- {
- owner.updateStatus(e);
- }
- }
- }
-
- static abstract class OneToMany
- {
-
- /** . */
- private final LazySet list;
-
- /** . */
- private boolean loaded;
-
- /** . */
- private Set<UIContainerObject> relateds;
-
- /** The contexts pointing at us via a ManyToOne. */
- private Set<ObjectContext> refs;
-
- private OneToMany()
- {
- this.list = new LazySet();
- this.loaded = false;
- this.relateds = new HashSet<UIContainerObject>();
- this.refs = new HashSet<ObjectContext>();
- }
-
- boolean isLoaded()
- {
- return loaded;
- }
-
- void addLoadedRelated(UIContainerObject related)
- {
- if (!isLoaded())
- {
- throw new IllegalStateException("Not loaded");
- }
- if (related == null)
- {
- throw new IllegalArgumentException("No null child accepted");
- }
-
- //
- for (UIContainerObject r : relateds)
- {
- if (related.getId().equals(r.getId()))
- {
- throw new IllegalStateException("Cannot add duplicate");
- }
- }
-
- //
- attach(related);
- }
-
- void setLoadedRelateds(Set<UIContainerObject> relateds)
- {
- if (!isLoaded())
- {
- throw new IllegalStateException("Not loaded");
- }
-
- //
- for (UIContainerObject related : new ArrayList<UIContainerObject>(this.relateds))
- {
- detach(related);
- }
-
- //
- for (UIContainerObject related : relateds)
- {
- attach(related);
- }
- }
-
- UIContainerObject removeLoadedRelated(String relatedId)
- {
- if (!isLoaded())
- {
- throw new IllegalStateException("Not loaded");
- }
- if (relatedId == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- for (UIContainerObject related : relateds)
- {
- if (relatedId.equals(related.getId()))
- {
- detach(related);
- return related;
- }
- }
-
- //
- throw new AssertionError("BUG");
- }
-
- Collection<UIContainerObject> getRelateds()
- {
- return list;
- }
-
- Set<ObjectContext> getReferences()
- {
- return refs;
- }
-
- /**
- * Load the related side.
- *
- * @return the list of structural objects
- * @throws StateException if the load operation cannot be achieved
- */
- protected abstract Collection<StructuralObject> doLoad() throws StateException;
-
- protected abstract ObjectContext getOwner();
-
- protected abstract ManyToOne getManyToOne(UIContainerObject related);
-
- private void detach(UIContainerObject related)
- {
- ManyToOne manyToOne = getManyToOne(related);
-
- //
- ObjectContext owner = getOwner();
-
- //
- if (!manyToOne.refs.contains(owner))
- {
- throw new AssertionError("BUG");
- }
-
- //
- manyToOne.refs.remove(owner);
- relateds.remove(related);
- }
-
- private void attach(UIContainerObject related)
- {
- ManyToOne manyToOne = getManyToOne(related);
-
- //
- ObjectContext owner = getOwner();
-
- //
- if (manyToOne.refs.contains(owner))
- {
- throw new AssertionError("Context already referenced by the provided object");
- }
-
- //
- manyToOne.refs.add(owner);
- relateds.add(related);
- }
-
- private void load()
- {
- ObjectContext owner = getOwner();
-
- //
- try
- {
- for (StructuralObject relatedSO : doLoad())
- {
- UIContainerObject related = owner.container.get(relatedSO);
-
- //
- if (related != null)
- {
- ObjectContext relatedContext = (ObjectContext)related.getContext();
-
- //
- if (!relatedContext.structuralObject.compareTo(relatedSO))
- {
- relatedContext.status = UIObject.Status.STALE;
- }
- }
- else
- {
- related = owner.container.create(relatedSO);
-
- //
- owner.container.attach(related);
- }
-
- //
- attach(related);
- }
-
- //
- this.loaded = true;
- }
- catch (StateException e)
- {
- owner.updateStatus(e);
- }
- }
-
- private class LazySet extends AbstractSet<UIContainerObject>
- {
-
- public Iterator<UIContainerObject> iterator()
- {
- final ObjectContext owner = getOwner();
-
- //
- owner.checkAccess();
-
- // Load the entire relationship
- if (!isLoaded())
- {
- load();
- }
-
- //
- owner.checkAccess();
-
- //
- final Iterator<UIContainerObject> iterator = relateds.iterator();
-
- //
- return new Iterator<UIContainerObject>()
- {
- public boolean hasNext()
- {
- owner.checkAccess();
-
- //
- return iterator.hasNext();
- }
-
- public UIContainerObject next()
- {
- owner.checkAccess();
-
- //
- return iterator.next();
- }
-
- public void remove()
- {
- owner.checkAccess();
-
- //
- throw new UnsupportedOperationException();
- }
- };
- }
-
- public int size()
- {
- ObjectContext owner = getOwner();
-
- //
- owner.checkAccess();
-
- //
- if (!isLoaded())
- {
- load();
- }
-
- //
- owner.checkAccess();
-
- //
- return relateds.size();
- }
-
- public String toString()
- {
- return "ProxyList[" + getOwner() + "]";
- }
- }
- }
-}
18 years, 3 months
JBoss Portal SVN: r9426 - in modules/portlet/trunk: test and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-03 08:51:51 -0500 (Thu, 03 Jan 2008)
New Revision: 9426
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/test/pom.xml
Log:
use jboss-vfs Beta instead of snapshot
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-01-03 11:53:57 UTC (rev 9425)
+++ modules/portlet/trunk/build/pom.xml 2008-01-03 13:51:51 UTC (rev 9426)
@@ -57,7 +57,7 @@
<version.apache.tomcat>5.5.12</version.apache.tomcat>
<version.jboss-common-core>2.2.1.GA</version.jboss-common-core>
<version.jboss-logging>2.0.3.GA</version.jboss-logging>
- <version.jboss-vfs>2.0.4.snapshot</version.jboss-vfs>
+ <version.jboss-vfs>2.0.0.Beta6</version.jboss-vfs>
<version.jboss.aop>2.0.0.beta1</version.jboss.aop>
<version.jbossxb>2.0.0.CR5</version.jbossxb>
<version.javassist>3.6-beta</version.javassist>
@@ -407,7 +407,7 @@
<version>${version.jboss-remoting}</version>
</dependency>
<dependency>
- <groupId>jboss</groupId>
+ <groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
<version>${version.jboss-vfs}</version>
</dependency>
Modified: modules/portlet/trunk/test/pom.xml
===================================================================
--- modules/portlet/trunk/test/pom.xml 2008-01-03 11:53:57 UTC (rev 9425)
+++ modules/portlet/trunk/test/pom.xml 2008-01-03 13:51:51 UTC (rev 9426)
@@ -113,7 +113,7 @@
<artifactId>jboss-remoting</artifactId>
</dependency>
<dependency>
- <groupId>jboss</groupId>
+ <groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
<scope>test</scope>
</dependency>
@@ -308,7 +308,7 @@
<property name="dependency.jboss-logging-spi.jar" value="${maven.dependency.jboss.jboss-logging-spi.jar.path}"/>
<property name="dependency.jboss-logging-jdk.jar" value="${maven.dependency.jboss.jboss-logging-jdk.jar.path}"/>
<property name="dependency.jboss-logging-log4j.jar" value="${maven.dependency.jboss.jboss-logging-log4j.jar.path}"/>
- <property name="dependency.jboss-vfs.jar" value="${maven.dependency.jboss.jboss-vfs.jar.path}"/>
+ <property name="dependency.jboss-vfs.jar" value="${maven.dependency.org.jboss.jboss-vfs.jar.path}"/>
<property name="dependency.jboss-aop-mc-int.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-aop-mc-int.jar.path}"/>
<property name="dependency.jboss-classloader.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-classloader.jar.path}"/>
<property name="dependency.jboss-container.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-container.jar.path}"/>
18 years, 4 months
JBoss Portal SVN: r9425 - modules/portlet/trunk/build.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-03 06:53:57 -0500 (Thu, 03 Jan 2008)
New Revision: 9425
Modified:
modules/portlet/trunk/build/pom.xml
Log:
plugin fix
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-01-03 11:10:19 UTC (rev 9424)
+++ modules/portlet/trunk/build/pom.xml 2008-01-03 11:53:57 UTC (rev 9425)
@@ -138,6 +138,11 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-maven2</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </plugin>
+ <plugin>
<artifactId>maven-idea-plugin</artifactId>
<configuration>
<downloadSources>true</downloadSources>
18 years, 4 months
JBoss Portal SVN: r9424 - branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-03 06:10:19 -0500 (Thu, 03 Jan 2008)
New Revision: 9424
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/ObjectContext.java
Log:
previous commit put back the AssociationContext class which has been renamed to RelationshipContext
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 11:06:37 UTC (rev 9423)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/ObjectContext.java 2008-01-03 11:10:19 UTC (rev 9424)
@@ -60,9 +60,6 @@
/** The status related to the structural object value. */
UIObject.Status status;
- /** */
- AssociationContext associationContext;
-
ObjectContext(
UIObjectContainer container,
UIContainerObject containerObject,
18 years, 4 months
JBoss Portal SVN: r9423 - modules/portlet/trunk/build.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-03 06:06:37 -0500 (Thu, 03 Jan 2008)
New Revision: 9423
Modified:
modules/portlet/trunk/build/pom.xml
Log:
change aop version to something that works...
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-01-03 06:55:45 UTC (rev 9422)
+++ modules/portlet/trunk/build/pom.xml 2008-01-03 11:06:37 UTC (rev 9423)
@@ -58,7 +58,7 @@
<version.jboss-common-core>2.2.1.GA</version.jboss-common-core>
<version.jboss-logging>2.0.3.GA</version.jboss-logging>
<version.jboss-vfs>2.0.4.snapshot</version.jboss-vfs>
- <version.jboss.aop>2.0.0.CR1</version.jboss.aop>
+ <version.jboss.aop>2.0.0.beta1</version.jboss.aop>
<version.jbossxb>2.0.0.CR5</version.jbossxb>
<version.javassist>3.6-beta</version.javassist>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
18 years, 4 months
JBoss Portal SVN: r9422 - branches/JBoss_Portal_Branch_2_6/build.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-01-03 01:55:45 -0500 (Thu, 03 Jan 2008)
New Revision: 9422
Modified:
branches/JBoss_Portal_Branch_2_6/build/build.xml
Log:
oops..broke it again.fixing the build
Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml 2008-01-03 06:51:22 UTC (rev 9421)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml 2008-01-03 06:55:45 UTC (rev 9422)
@@ -108,7 +108,9 @@
<!-- Sets up the module configuration. -->
<moduleconfig property="modules" selected="${groups}">
+
<!-- Modules -->
+
<module name="jems"/>
<module name="security"/>
<module name="faces"/>
@@ -116,48 +118,28 @@
<module name="server"/>
<module name="portlet-server"/>
<module name="theme"/>
- <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="cms"/>
+ <module name="format"/>
+ <module name="core"/>
+ <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, format, portlet-server, faces, theme,registration, presentation, core, core-presentation, core-samples"/>
+ 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"/>
</group>
<group name="cms">
@@ -556,4 +538,4 @@
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
</target>
-</project>
+</project>
\ No newline at end of file
18 years, 4 months
JBoss Portal SVN: r9421 - in branches: presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model and 9 other directories.
by portal-commits@lists.jboss.org
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,
18 years, 4 months
JBoss Portal SVN: r9420 - modules/common/trunk.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-02 19:21:34 -0500 (Wed, 02 Jan 2008)
New Revision: 9420
Modified:
modules/common/trunk/pom.xml
Log:
enable jboss-deploy to the legacy repo
Modified: modules/common/trunk/pom.xml
===================================================================
--- modules/common/trunk/pom.xml 2008-01-02 23:27:24 UTC (rev 9419)
+++ modules/common/trunk/pom.xml 2008-01-03 00:21:34 UTC (rev 9420)
@@ -51,6 +51,23 @@
<version>1.0-beta-2</version>
</extension>
</extensions>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jboss-deploy-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jboss-deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
+ </configuration>
+ </plugin>
+ </plugins>
<pluginManagement>
<plugins>
<plugin>
@@ -88,22 +105,8 @@
<downloadSources>true</downloadSources>
</configuration>
</plugin>
+
<plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jboss-deploy-plugin</artifactId>
- <version>1.3</version>
- <executions>
- <execution>
- <goals>
- <goal>jboss-deploy</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
- </configuration>
- </plugin>
- <plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
@@ -119,12 +122,12 @@
</build>
<distributionManagement>
- <!--<repository>-->
- <!--Copy the distribution jar file to a local checkout of the maven repository
+ <repository>
+ <!--Copy the distribution jar file to a local checkout of the maven repository
- This variable can be set in $MAVEN_HOME/conf/settings.xml-->
- <!--<id>repository.jboss.org</id>-->
- <!--<url>file://${jboss.repository.root}</url>-->
- <!--</repository>-->
+ <id>repository.jboss.org</id>
+ <url>file://${jboss.repository.root}</url>
+ </repository>
<snapshotRepository>
<id>snapshots.jboss.org</id>
<name>JBoss Snapshot Repository</name>
18 years, 4 months
JBoss Portal SVN: r9419 - in modules/portlet/trunk: portlet and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-02 18:27:24 -0500 (Wed, 02 Jan 2008)
New Revision: 9419
Modified:
modules/portlet/trunk/federation/pom.xml
modules/portlet/trunk/portlet/pom.xml
Log:
enable reports generation
Modified: modules/portlet/trunk/federation/pom.xml
===================================================================
--- modules/portlet/trunk/federation/pom.xml 2008-01-02 21:54:31 UTC (rev 9418)
+++ modules/portlet/trunk/federation/pom.xml 2008-01-02 23:27:24 UTC (rev 9419)
@@ -52,6 +52,10 @@
<config>jboss-unit.xml</config>
</testsuite>
</testsuites>
+ <reports>
+ <xml>target/tests/reports/xml</xml>
+ <html>target/tests/reports/html</html>
+ </reports>
</configuration>
</plugin>
</plugins>
Modified: modules/portlet/trunk/portlet/pom.xml
===================================================================
--- modules/portlet/trunk/portlet/pom.xml 2008-01-02 21:54:31 UTC (rev 9418)
+++ modules/portlet/trunk/portlet/pom.xml 2008-01-02 23:27:24 UTC (rev 9419)
@@ -76,6 +76,10 @@
<config>local-jboss-unit.xml</config>
</testsuite>
</testsuites>
+ <reports>
+ <xml>target/tests/reports/xml</xml>
+ <html>target/tests/reports/html</html>
+ </reports>
</configuration>
</plugin>
</plugins>
18 years, 4 months