Author: julien(a)jboss.com
Date: 2008-07-07 18:14:53 -0400 (Mon, 07 Jul 2008)
New Revision: 11336
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
Log:
have window close work in the ajax
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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;
+
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxRequest;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxAction;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
+import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
+import org.jboss.portal.presentation.ajax.client.utils.Logger;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AgentContext
+{
+
+ /** . */
+ private static final Logger log = Logger.getLogger(AgentContext.class);
+
+ /** . */
+ AjaxObject.Context objectContext;
+
+ /** . */
+ PresentationClientAgent agent;
+
+ public void process(AjaxAction action)
+ {
+ AjaxRequest request = new AjaxRequest();
+ request.setAction(action);
+
+ //
+ agent.getProxy().process(request, new AsyncCallback()
+ {
+ public void onFailure(Throwable throwable)
+ {
+ }
+
+ public void onSuccess(Object o)
+ {
+ AjaxResponse response = (AjaxResponse)o;
+
+ //
+ for (int i = 0; i < response.getStaleObjects().length; i++)
+ {
+ String staleObject = response.getStaleObjects()[i];
+
+ //
+ AjaxObject stale = objectContext.getObject(staleObject);
+
+ //
+ if (stale != null)
+ {
+ log.info("Going to refresh object " + staleObject);
+ stale.refresh(true);
+ }
+ else
+ {
+ log.info("No stale object for " + staleObject);
+ }
+ }
+
+ //
+ objectContext.update(response.getModelUpdates());
+
+ //
+ objectContext.getRoot().refresh(false);
+ }
+ });
+ }
+
+}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -58,8 +58,13 @@
private Map pages = new HashMap();
/** . */
- private PresentationClientRemoteAsync remote;
+ private PresentationClientRemoteAsync proxy;
+ PresentationClientRemoteAsync getProxy()
+ {
+ return proxy;
+ }
+
public void onModuleLoad()
{
VerticalPanel main = new VerticalPanel();
@@ -80,9 +85,9 @@
//
Bootstrap.init();
- // Initialize the remote service
- remote =
(PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
- ServiceDefTarget endpoint = (ServiceDefTarget)remote;
+ // Initialize the proxy service
+ proxy = (PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
+ ServiceDefTarget endpoint = (ServiceDefTarget)proxy;
String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
endpoint.setServiceEntryPoint(moduleRelativeURL);
@@ -99,9 +104,16 @@
ModelUpdate[] updates = (ModelUpdate[])o;
//
- AjaxObject.Context context = new AjaxObject.Context();
+ AgentContext agentContext = new AgentContext();
+ agentContext.agent = PresentationClientAgent.this;
//
+ AjaxObject.Context context = new AjaxObject.Context(agentContext);
+
+ //
+ agentContext.objectContext = context;
+
+ //
context.update(updates);
//
@@ -113,7 +125,7 @@
};
//
- remote.ping(callback);
+ proxy.ping(callback);
}
private static class SimpleAppender extends FlowPanel implements Appender
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -115,4 +115,8 @@
protected void doAddChild(AjaxObject child)
{
}
+
+ protected void doRemoveChild(AjaxObject child)
+ {
+ }
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -34,7 +34,11 @@
import org.jboss.portal.presentation.ajax.client.model.update.ObjectType;
import org.jboss.portal.presentation.ajax.client.model.update.CreateChildren;
import org.jboss.portal.presentation.ajax.client.model.update.AddChild;
+import org.jboss.portal.presentation.ajax.client.model.update.UpdateObject;
+import org.jboss.portal.presentation.ajax.client.model.update.RemoveChild;
+import org.jboss.portal.presentation.ajax.client.model.update.RemoveObject;
import org.jboss.portal.presentation.ajax.client.utils.Logger;
+import org.jboss.portal.presentation.ajax.client.AgentContext;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -97,17 +101,40 @@
}
}
- public final void refresh(boolean force)
+ private void refreshRecursive(boolean force)
{
+ for (Iterator i = getChildren().iterator();i.hasNext();)
+ {
+ AjaxObject child = (AjaxObject)i.next();
+
+ //
+ child.refreshRecursive(force);
+ }
+
+ //
if (stale || force)
{
+ context.log.info("Starting refresh of object " + id);
+
+ //
doRefresh(force);
//
+ context.log.info("Finished refresh of object " + id);
+
+ //
stale = false;
}
}
+ public final void refresh(boolean force)
+ {
+ context.log.info("Requesting for" + (force ? " forced " :
" ") + "refresh of object " + id);
+
+ //
+ refreshRecursive(force);
+ }
+
private void addChild(AjaxObject child)
{
// Create relationship
@@ -121,6 +148,18 @@
stale = true;
}
+ public void removeChild(AjaxObject child)
+ {
+ doRemoveChild(child);
+
+ //
+ children.remove(child.getId());
+ child.parent = null;
+
+ //
+ stale = true;
+ }
+
public final boolean isStale()
{
return stale;
@@ -175,11 +214,20 @@
/** . */
private AjaxPage root;
- public Context()
+ /** . */
+ private final AgentContext agentContext;
+
+ public Context(AgentContext agentContext)
{
+ this.agentContext = agentContext;
this.objects = new HashMap();
}
+ public AgentContext getAgentContext()
+ {
+ return agentContext;
+ }
+
public AjaxObject getObject(String objectId)
{
return (AjaxObject)objects.get(objectId);
@@ -235,6 +283,21 @@
// We create the widget
object.createWidget();
}
+ else if (update instanceof UpdateObject)
+ {
+ UpdateObject updateObject = (UpdateObject)update;
+
+ //
+ AjaxObject object = (AjaxObject)objects.get(updateObject.getObjectId());
+
+ //
+
object.properties.keySet().removeAll(updateObject.getRemovedProperties());
+ object.properties.putAll(updateObject.getUpdatedProperties());
+ object.properties.putAll(updateObject.getAddedProperties());
+
+ //
+ object.stale = true;
+ }
else if (update instanceof CreateChildren)
{
}
@@ -249,10 +312,43 @@
//
parent.addChild(child);
}
+ else if (update instanceof RemoveChild)
+ {
+ RemoveChild removeChild = (RemoveChild)update;
+
+ //
+ AjaxObject parent = (AjaxObject)objects.get(removeChild.getParentId());
+ AjaxObject child = (AjaxObject)objects.get(removeChild.getChildId());
+
+ //
+ parent.removeChild(child);
+
+ //
+ log.info("Child " + removeChild.getChildId() + " removed
from parent " + removeChild.getParentId());
+ }
+ else if (update instanceof RemoveObject)
+ {
+ RemoveObject removeObject = (RemoveObject)update;
+
+ //
+ AjaxObject object =
(AjaxObject)objects.remove(removeObject.getObjectId());
+
+ //
+ if (object == null)
+ {
+ log.error("Cannot remove object " +
removeObject.getObjectId() + " because it cannot be located");
+
+ //
+ throw new IllegalStateException();
+ }
+
+ //
+ object.destroyWidget();
+
+ //
+ log.info("Destroyed object " + removeObject.getObjectId());
+ }
}
-
- // We refresh the root
- root.refresh(false);
}
}
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -27,7 +27,6 @@
import com.google.gwt.user.client.ui.Widget;
import java.util.Map;
-import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -46,15 +45,6 @@
protected void doRefresh(boolean force)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
- {
- AjaxObject child = (AjaxObject)i.next();
-
- //
- child.refresh(force);
- }
-
- //
doRefresh(widget);
}
@@ -65,16 +55,17 @@
protected void doCreateWidget()
{
- Label title = new Label();
- title.setText("Page " + getId());
- title.setStyleName("pf-Title");
+ Label title = new Label("Page " + getId());
+ MetaWidget meta = new MetaWidget(this);
+ VerticalPanel widget = new VerticalPanel();
//
- VerticalPanel widget = new VerticalPanel();
- widget.setStyleName("pf-Page");
+ meta.add(title);
+ widget.add(meta);
//
- widget.add(title);
+ title.setStyleName("pf-Title");
+ widget.setStyleName("pf-Page");
//
this.widget = widget;
@@ -82,11 +73,6 @@
protected void doDestroyWidget()
{
- throw new UnsupportedOperationException();
+ widget = null;
}
-
- protected void doRemoveChild(AjaxObject child)
- {
- throw new UnsupportedOperationException();
- }
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -24,10 +24,8 @@
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.Hyperlink;
import java.util.Map;
-import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -55,28 +53,14 @@
protected void doRefresh(boolean force)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
- {
- AjaxObject child = (AjaxObject)i.next();
-
- //
- child.refresh(force);
- }
-
- //
doRefresh(widget);
}
protected void doDestroyWidget()
{
- throw new UnsupportedOperationException();
+ widget = null;
}
- protected void doRemoveChild(AjaxObject child)
- {
- throw new UnsupportedOperationException();
- }
-
public Widget getWidget()
{
return widget;
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -37,8 +37,6 @@
import org.jboss.portal.presentation.ajax.client.PresentationClientRemoteAsync;
import org.jboss.portal.presentation.ajax.client.PresentationClientRemote;
import org.jboss.portal.presentation.ajax.client.protocol.OpaqueWindowAction;
-import org.jboss.portal.presentation.ajax.client.protocol.AjaxRequest;
-import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
import org.jboss.portal.presentation.ajax.client.protocol.DestroyObjectAction;
import org.jboss.portal.presentation.ajax.client.utils.Tools;
import org.jboss.portal.presentation.ajax.client.utils.Logger;
@@ -83,48 +81,12 @@
{
public void onClick(Widget widget)
{
- DestroyObjectAction action = new DestroyObjectAction(getId());
- AjaxRequest request = new AjaxRequest();
- request.setAction(action);
-
- //
- final PresentationClientRemoteAsync remote =
(PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
- ServiceDefTarget endpoint = (ServiceDefTarget)remote;
- String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
- endpoint.setServiceEntryPoint(moduleRelativeURL);
-
- //
- remote.process(request, new AsyncCallback()
- {
- public void onFailure(Throwable throwable)
- {
- }
-
- public void onSuccess(Object o)
- {
- AjaxResponse response = (AjaxResponse)o;
-// for (int i = 0; i < response.getStaleObjects().length; i++)
-// {
-// String staleObject = response.getStaleObjects()[i];
-//
-// AjaxObject stale = getContext().getObject(staleObject);
-//
-// if (stale != null)
-// {
-// log.info("Going to refresh portlet window " +
staleObject);
-// stale.refresh(true);
-// }
-// else
-// {
-// log.info("No stale window found for " +
staleObject);
-// }
-//
-// }
- }
- });
+ getContext().getAgentContext().process(new DestroyObjectAction(getId()));
}
});
MetaWidget meta = new MetaWidget(this);
+
+ //
meta.add(title);
widget.add(meta);
widget.add(close);
@@ -239,48 +201,7 @@
if (windowAction != null)
{
log.info("About to execute window action " + windowAction);
-
- //
- final PresentationClientRemoteAsync remote =
(PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
- ServiceDefTarget endpoint = (ServiceDefTarget)remote;
- String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
- endpoint.setServiceEntryPoint(moduleRelativeURL);
-
- //
- AjaxRequest request = new AjaxRequest();
- request.setAction(windowAction);
-
- //
- remote.process(request, new AsyncCallback()
- {
- public void onFailure(Throwable throwable)
- {
- }
-
- public void onSuccess(Object o)
- {
- AjaxResponse response = (AjaxResponse)o;
-
- for (int i = 0; i < response.getStaleObjects().length; i++)
- {
- String staleObject = response.getStaleObjects()[i];
-
- AjaxObject stale = getContext().getObject(staleObject);
-
- if (stale != null)
- {
- log.info("Going to refresh portlet window " +
staleObject);
- stale.refresh(true);
- }
- else
- {
- log.info("No stale window found for " +
staleObject);
- }
-
- }
-
- }
- });
+ getContext().getAgentContext().process(windowAction);
}
}
});
@@ -288,7 +209,6 @@
protected void doDestroyWidget()
{
- throw new UnsupportedOperationException();
}
protected void doRemoveChild(AjaxObject child)
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -96,11 +96,19 @@
{
public void onClick(Widget widget)
{
+ object.refresh(false);
+ }
+ }));
+
+
+ popup.add(new Button("Force refresh", new
ClickListener()
+ {
+ public void onClick(Widget widget)
+ {
object.refresh(true);
}
}));
-
MetaWidget.this.popup = popup;
add(popup);
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -53,6 +53,6 @@
public String toString()
{
- return "CreaterChildren[objectId=" + objectId + "]";
+ return "CreateChildren[objectId=" + objectId + "]";
}
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -23,6 +23,7 @@
package org.jboss.portal.presentation.ajax.client.protocol;
import com.google.gwt.user.client.rpc.IsSerializable;
+import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -35,14 +36,19 @@
private static final String[] EMPTY_STRINGS = new String[0];
/** . */
+ private static final ModelUpdate[] EMPTY_UPDATES = new ModelUpdate[0];
+
+ /** . */
private String[] staleObjects;
+ private ModelUpdate[] modelUpdates;
+
public AjaxResponse()
{
- this(EMPTY_STRINGS);
+ this(EMPTY_STRINGS, EMPTY_UPDATES);
}
- public AjaxResponse(String[] staleObjects)
+ public AjaxResponse(String[] staleObjects, ModelUpdate[] modelUpdates)
{
if (staleObjects == null)
{
@@ -51,6 +57,7 @@
//
this.staleObjects = staleObjects;
+ this.modelUpdates = modelUpdates;
}
public String[] getStaleObjects()
@@ -62,4 +69,14 @@
{
this.staleObjects = staleObjects;
}
+
+ public ModelUpdate[] getModelUpdates()
+ {
+ return modelUpdates;
+ }
+
+ public void setModelUpdates(ModelUpdate[] modelUpdates)
+ {
+ this.modelUpdates = modelUpdates;
+ }
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -229,15 +229,7 @@
ModelUpdate[] updates =
((AjaxViewPortContext)viewPort.getContext()).getDelta();
//
- for (int i = 0; i < updates.length; i++)
- {
- ModelUpdate update = updates[i];
- System.out.println("update = " + update);
- }
-
-
- //
- return new AjaxResponse(tmp.toArray(new String[tmp.size()]));
+ return new AjaxResponse(tmp.toArray(new String[tmp.size()]), updates);
}
catch (PresentationServerException e)
{
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java 2008-07-07
20:53:32 UTC (rev 11335)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java 2008-07-07
22:14:53 UTC (rev 11336)
@@ -37,12 +37,14 @@
import org.jboss.portal.presentation.ajax.client.model.update.AddChild;
import org.jboss.portal.presentation.ajax.client.model.update.RemoveChild;
import org.jboss.portal.presentation.ajax.client.model.update.ObjectType;
+import org.jboss.portal.presentation.ajax.client.model.update.UpdateObject;
import org.jboss.portal.common.NotYetImplemented;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
+import java.util.HashSet;
import java.io.Serializable;
/**
@@ -116,7 +118,12 @@
public void updateObject(String objectId, Set<String> removedProperties,
Map<String, Serializable> updatedProperties, Map<String, Serializable>
addedProperties)
{
- throw new NotYetImplemented("todo");
+ updates.add(new UpdateObject(
+ objectId,
+ new HashSet(removedProperties),
+ new HashMap(updatedProperties),
+ new HashMap(addedProperties)
+ ));
}
public void removeObject(String objectId)