JBoss Portal SVN: r11309 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-07-07 02:23:05 -0400 (Mon, 07 Jul 2008)
New Revision: 11309
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
making "Operating System Environment Settings" sections
consistent with 2.7 branch
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-07-06 20:55:31 UTC (rev 11308)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-07-07 06:23:05 UTC (rev 11309)
@@ -75,17 +75,67 @@
Files contained in this download are used in later sections. Download and extract the JBoss Portal binary ZIP file before proceeding.
</para>
</sect3>
- <sect3>
- <title>JBoss EAP and JBoss AS Setup</title>
- <para>Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS installed. Customers who have access to the <ulink url="https://support.redhat.com/portal/login.html">JBoss Customer Support Portal (CSP)</ulink> are advised to download and install JBoss EAP 4.3. Customers who do not have access to the JBoss CSP are advised to use <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>. For JBoss AS installation instructions, please refer to the <ulink url="http://labs.jboss.com/jbossas/docs/index.html">JBoss AS Installation Guide</ulink>.
- </para>
- <warning>
- <title>Use the JBoss EAP and JBoss AS ZIP file</title>
- <para>
- Only use the JBoss EAP and JBoss AS ZIP file versions. <emphasis role="bold">DO NOT ATTEMPT to deploy JBoss Portal on the installer version of JBoss EAP or JBoss AS.</emphasis>
- </para>
- </warning>
+ <sect3>
+ <title>JBoss EAP and JBoss AS Setup</title>
+ <para>Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS installed. Customers who have access to the <ulink url="https://support.redhat.com/portal/login.html">JBoss Customer Support Portal (CSP)</ulink> are advised to download and install JBoss EAP 4.3. Customers who do not have access to the JBoss CSP are advised to use <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>. For JBoss AS installation instructions, please refer to the <ulink url="http://labs.jboss.com/jbossas/docs/index.html">JBoss AS Installation Guide</ulink>.
+ </para>
+ <warning>
+ <title>Use the JBoss EAP and JBoss AS ZIP file</title>
+ <para>
+ Only use the JBoss EAP and JBoss AS ZIP file versions. <emphasis role="bold">DO NOT ATTEMPT to deploy JBoss Portal on the installer version of JBoss EAP or JBoss AS.</emphasis>
+ </para>
+ </warning>
</sect3>
+ <sect3 id="install_source_env_0">
+ <title>Operating System Environment Settings</title>
+ <para>For JBoss EAP, JBoss AS, and build targets to work, you must configure a <filename>JBOSS_HOME</filename> environment variable. This environment variable must point to the root directory of the JBoss EAP or JBoss AS installation directory, which is the directory where the JBoss EAP or JBoss AS files were extracted to.
+ </para>
+ <para>On Windows, this is accomplished by going to
+ <emphasis>Start > Settings > Control Panel > System > Advanced > Environment Variables</emphasis>. Under the
+ <emphasis>System Variables</emphasis>
+ section, click
+ <emphasis>New</emphasis>. Set the <filename>JBOSS_HOME</filename>
+ environment variable to the location of your JBoss EAP or JBoss AS installation directory:
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ To configure the <filename>JBOSS_HOME</filename> environment variable on Linux:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Add the following line to the <filename>~/.bashrc</filename> file. Note: this must be configured while logged in as the user who runs JBoss EAP or JBoss AS:
+ </para>
+ <para>
+<screen>
+export JBOSS_HOME=/path/to/jboss/installation/
+</screen>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Run the following command to enable the <filename>JBOSS_HOME</filename> environment variable:
+ </para>
+ <para>
+<screen>
+source ~/.bashrc
+</screen>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <note>
+ <title>JBoss EAP <filename>JBOSS_HOME</filename> Environment Variable</title>
+ <para>
+ If you are running JBoss EAP, configure the <filename>JBOSS_HOME</filename> environment variable to point to the <filename>/path/to/jboss-eap-<replaceable>version</replaceable>/jboss-as/</filename> directory.
+ </para>
+ </note>
+ </sect3>
<sect3>
<title>Database Setup</title>
<para>
@@ -262,54 +312,54 @@
</warning>
</sect3>
<sect3 id="install_source_env">
- <title>Operating System Environment Settings</title>
- <para>For build targets to work, you must configure a <filename>JBOSS_HOME</filename> environment variable. This environment variable must point to the root directory of the JBoss EAP or JBoss AS installation directory, which is the directory where the JBoss EAP or JBoss AS files were extracted to.
- </para>
- <para>On Windows, this is accomplished by going to
- <emphasis>Start > Settings > Control Panel > System > Advanced > Environment Variables</emphasis>. Under the
- <emphasis>System Variables</emphasis>
- section, click
- <emphasis>New</emphasis>. Set the <filename>JBOSS_HOME</filename>
- environment variable to the location of your JBoss EAP or JBoss AS installation directory:
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- To configure the <filename>JBOSS_HOME</filename> environment variable on Linux:
- </para>
- <para>
- <orderedlist>
- <listitem>
- <para>
- Add the following line to the <filename>~/.bashrc</filename> file. Note: this must be configured while logged in as the user who runs JBoss EAP or JBoss AS:
- </para>
- <para>
+ <title>Operating System Environment Settings</title>
+ <para>For JBoss EAP, JBoss AS, and build targets to work, you must configure a <filename>JBOSS_HOME</filename> environment variable. This environment variable must point to the root directory of the JBoss EAP or JBoss AS installation directory, which is the directory where the JBoss EAP or JBoss AS files were extracted to.
+ </para>
+ <para>On Windows, this is accomplished by going to
+ <emphasis>Start > Settings > Control Panel > System > Advanced > Environment Variables</emphasis>. Under the
+ <emphasis>System Variables</emphasis>
+ section, click
+ <emphasis>New</emphasis>. Set the <filename>JBOSS_HOME</filename>
+ environment variable to the location of your JBoss EAP or JBoss AS installation directory:
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ To configure the <filename>JBOSS_HOME</filename> environment variable on Linux:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Add the following line to the <filename>~/.bashrc</filename> file. Note: this must be configured while logged in as the user who runs JBoss EAP or JBoss AS:
+ </para>
+ <para>
<screen>
export JBOSS_HOME=/path/to/jboss/installation/
</screen>
- </para>
- </listitem>
- <listitem>
- <para>
- Run the following command to enable the <filename>JBOSS_HOME</filename> environment variable:
- </para>
- <para>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Run the following command to enable the <filename>JBOSS_HOME</filename> environment variable:
+ </para>
+ <para>
<screen>
source ~/.bashrc
</screen>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <note>
- <title>JBoss EAP <filename>JBOSS_HOME</filename> Environment Variable</title>
- <para>
- If you are running JBoss EAP, configure the <filename>JBOSS_HOME</filename> environment variable to point to the <filename>/path/to/jboss-eap-<replaceable>version</replaceable>/jboss-as/</filename> directory.
- </para>
- </note>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <note>
+ <title>JBoss EAP <filename>JBOSS_HOME</filename> Environment Variable</title>
+ <para>
+ If you are running JBoss EAP, configure the <filename>JBOSS_HOME</filename> environment variable to point to the <filename>/path/to/jboss-eap-<replaceable>version</replaceable>/jboss-as/</filename> directory.
+ </para>
+ </note>
</sect3>
</sect2>
<sect2 id="building_deploying_from_source">
16 years
JBoss Portal SVN: r11308 - modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-06 16:55:31 -0400 (Sun, 06 Jul 2008)
New Revision: 11308
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectDiff.java
Log:
symetric SingeLoad/RecursiveLoad
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:37:56 UTC (rev 11307)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:55:31 UTC (rev 11308)
@@ -253,7 +253,7 @@
}
else
{
- return ObjectDiff.createLoad(object);
+ return ObjectDiff.createSingleLoad(object);
}
}
}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectDiff.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectDiff.java 2008-07-06 20:37:56 UTC (rev 11307)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectDiff.java 2008-07-06 20:55:31 UTC (rev 11308)
@@ -46,9 +46,9 @@
return new RecursiveLoad(object, addedChildren);
}
- static ObjectDiff createLoad(UIObjectImpl object)
+ static ObjectDiff createSingleLoad(UIObjectImpl object)
{
- return new Load(object);
+ return new SingleLoad(object);
}
static ObjectDiff createSkip(UIObjectImpl object)
@@ -119,15 +119,22 @@
}
}
- public static class Load extends ObjectDiff
+ public abstract static class Load extends ObjectDiff
{
-
private Load(UIObjectImpl object)
{
super(object);
}
}
+ public static class SingleLoad extends Load
+ {
+ private SingleLoad(UIObjectImpl object)
+ {
+ super(object);
+ }
+ }
+
public static class RecursiveLoad extends Load
{
@@ -280,7 +287,7 @@
}
}
- public static class Update extends ObjectDiff
+ public abstract static class Update extends ObjectDiff
{
/** . */
16 years
JBoss Portal SVN: r11307 - modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-06 16:37:56 -0400 (Sun, 06 Jul 2008)
New Revision: 11307
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectDiff.java
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ViewPortImpl.java
Log:
rename ObjectVisit to ObjectDiff
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:35:49 UTC (rev 11306)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:37:56 UTC (rev 11307)
@@ -53,7 +53,7 @@
private final StructuralStateContext structuralStateContext;
/** . */
- private ObjectVisit rootVisit;
+ private ObjectDiff rootDiff;
public CreateDiffPhase(
ViewPortContext context,
@@ -69,15 +69,15 @@
public void perform()
{
- rootVisit = diff(scope.getRootId());
+ rootDiff = diff(scope.getRootId());
}
- public ObjectVisit getRootVisit()
+ public ObjectDiff getRootVisit()
{
- return rootVisit;
+ return rootDiff;
}
- private ObjectVisit diff(String objectId)
+ private ObjectDiff diff(String objectId)
{
UIObjectImpl object = (UIObjectImpl)context.getObject(objectId);
@@ -101,17 +101,17 @@
}
}
- private ObjectVisit.Evict createEvict(UIObjectImpl object)
+ private ObjectDiff.Evict createEvict(UIObjectImpl object)
{
- Collection<ObjectVisit.Evict> evictedChildren = createEvictedChildren(object);
+ Collection<ObjectDiff.Evict> evictedChildren = createEvictedChildren(object);
//
- return ObjectVisit.createEvict(object, evictedChildren);
+ return ObjectDiff.createEvict(object, evictedChildren);
}
- private Collection<ObjectVisit.Evict> createEvictedChildren(UIObjectImpl object)
+ private Collection<ObjectDiff.Evict> createEvictedChildren(UIObjectImpl object)
{
- Collection<ObjectVisit.Evict> evictedChildren = new ArrayList<ObjectVisit.Evict>();
+ Collection<ObjectDiff.Evict> evictedChildren = new ArrayList<ObjectDiff.Evict>();
//
InternalObjectContext objectContext = (InternalObjectContext)object.getContext();
@@ -133,7 +133,7 @@
return evictedChildren;
}
- private ObjectVisit diff(UIObjectImpl object)
+ private ObjectDiff diff(UIObjectImpl object)
{
ObjectTraversalType traversalType = scope.enterObject(object);
@@ -151,10 +151,10 @@
//
if (traversalType == ObjectTraversalType.RECURSIVE)
{
- Collection<ObjectVisit> addedObjects = new ArrayList<ObjectVisit>();
- Collection<ObjectVisit> validObjects = new ArrayList<ObjectVisit>();
- Collection<ObjectVisit> staleObjects = new ArrayList<ObjectVisit>();
- Collection<ObjectVisit> removedObjects = new ArrayList<ObjectVisit>();
+ Collection<ObjectDiff> addedObjects = new ArrayList<ObjectDiff>();
+ Collection<ObjectDiff> validObjects = new ArrayList<ObjectDiff>();
+ Collection<ObjectDiff> staleObjects = new ArrayList<ObjectDiff>();
+ Collection<ObjectDiff> removedObjects = new ArrayList<ObjectDiff>();
//
for (StructuralObject addedStructuralChild : refresh.getAddedChildren())
@@ -165,15 +165,15 @@
//
for (StructuralObject staleStructuralChild : refresh.getStaleChildren().values())
{
- ObjectVisit childVisit = diff(staleStructuralChild.getId());
- staleObjects.add(childVisit);
+ ObjectDiff childDiff = diff(staleStructuralChild.getId());
+ staleObjects.add(childDiff);
}
//
for (String validChildId : refresh.getValidChildren())
{
- ObjectVisit childVisit = diff(validChildId);
- validObjects.add(childVisit);
+ ObjectDiff childDiff = diff(validChildId);
+ validObjects.add(childDiff);
}
//
@@ -184,7 +184,7 @@
//
if (removedChild != null)
{
- ObjectVisit.Evict childVisit = createEvict(removedChild);
+ ObjectDiff.Evict childVisit = createEvict(removedChild);
removedObjects.add(childVisit);
}
else
@@ -195,7 +195,7 @@
}
//
- return ObjectVisit.createRecursiveUpdate(
+ return ObjectDiff.createRecursiveUpdate(
object,
refresh.getRemovedProperties(),
refresh.getUpdatedProperties(),
@@ -208,10 +208,10 @@
else
{
- Collection<ObjectVisit.Evict> evictedChildren = createEvictedChildren(object);
+ Collection<ObjectDiff.Evict> evictedChildren = createEvictedChildren(object);
//
- return ObjectVisit.createSingleUpdate(
+ return ObjectDiff.createSingleUpdate(
object,
refresh.getRemovedProperties(),
refresh.getUpdatedProperties(),
@@ -226,7 +226,7 @@
}
}
- private ObjectVisit load(StructuralObject structuralObject)
+ private ObjectDiff load(StructuralObject structuralObject)
{
UIObjectImpl object = UIObjectImpl.create(structuralObject, new InternalObjectContext(navigationalStateContext));
@@ -238,22 +238,22 @@
{
if (traversalType == ObjectTraversalType.SKIP)
{
- return ObjectVisit.createSkip(object);
+ return ObjectDiff.createSkip(object);
}
else
{
if (traversalType == ObjectTraversalType.RECURSIVE)
{
- Collection<ObjectVisit> addedChildren = new ArrayList<ObjectVisit>();
+ Collection<ObjectDiff> addedChildren = new ArrayList<ObjectDiff>();
for (StructuralObject structuralChild : structuralStateContext.loadChildren(structuralObject))
{
addedChildren.add(load(structuralChild));
}
- return ObjectVisit.createRecursiveLoad(object, addedChildren);
+ return ObjectDiff.createRecursiveLoad(object, addedChildren);
}
else
{
- return ObjectVisit.createLoad(object);
+ return ObjectDiff.createLoad(object);
}
}
}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-07-06 20:35:49 UTC (rev 11306)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-07-06 20:37:56 UTC (rev 11307)
@@ -45,7 +45,7 @@
private final ViewPortContext context;
/** . */
- private ObjectVisit rootVisit;
+ private ObjectDiff rootDiff;
/** . */
private ObjectUpdate rootUpdate;
@@ -56,10 +56,10 @@
/** . */
private Set<String> removedChildren;
- public CreateUpdatePhase(ViewPortContext context, ObjectVisit rootVisit)
+ public CreateUpdatePhase(ViewPortContext context, ObjectDiff rootDiff)
{
this.context = context;
- this.rootVisit = rootVisit;
+ this.rootDiff = rootDiff;
}
public ObjectUpdate getRootUpdate()
@@ -73,7 +73,7 @@
removedChildren = new HashSet<String>();
//
- rootUpdate = createUpdate(rootVisit);
+ rootUpdate = createUpdate(rootDiff);
//
if (deferredAddChildUpdates.size() > 0)
@@ -82,26 +82,26 @@
}
}
- private ObjectUpdate createUpdate(ObjectVisit visit)
+ private ObjectUpdate createUpdate(ObjectDiff diff)
{
- UIObjectImpl object = (UIObjectImpl)context.getObject(visit.getObjectId());
+ UIObjectImpl object = (UIObjectImpl)context.getObject(diff.getObjectId());
- if (visit instanceof ObjectVisit.RecursiveLoad || visit instanceof ObjectVisit.RecursiveUpdate)
+ if (diff instanceof ObjectDiff.RecursiveLoad || diff instanceof ObjectDiff.RecursiveUpdate)
{
- Collection<ObjectVisit> addedObjects;
- Collection<ObjectVisit> validObjects;
- Collection<ObjectVisit> staleObjects;
- Collection<ObjectVisit> removedObjects;
- if (visit instanceof ObjectVisit.RecursiveUpdate)
+ Collection<ObjectDiff> addedObjects;
+ Collection<ObjectDiff> validObjects;
+ Collection<ObjectDiff> staleObjects;
+ Collection<ObjectDiff> removedObjects;
+ if (diff instanceof ObjectDiff.RecursiveUpdate)
{
- addedObjects = ((ObjectVisit.RecursiveUpdate)visit).getAddedChildren();
- validObjects = ((ObjectVisit.RecursiveUpdate)visit).getValidChildren();
- staleObjects = ((ObjectVisit.RecursiveUpdate)visit).getStaleChildren();
- removedObjects = ((ObjectVisit.RecursiveUpdate)visit).getRemovedChildren();
+ addedObjects = ((ObjectDiff.RecursiveUpdate)diff).getAddedChildren();
+ validObjects = ((ObjectDiff.RecursiveUpdate)diff).getValidChildren();
+ staleObjects = ((ObjectDiff.RecursiveUpdate)diff).getStaleChildren();
+ removedObjects = ((ObjectDiff.RecursiveUpdate)diff).getRemovedChildren();
}
else
{
- addedObjects = ((ObjectVisit.RecursiveLoad)visit).getAddedChildren();
+ addedObjects = ((ObjectDiff.RecursiveLoad)diff).getAddedChildren();
validObjects = Collections.emptyList();
staleObjects = Collections.emptyList();
removedObjects = Collections.emptyList();
@@ -110,7 +110,7 @@
//
if (object != null)
{
- if (object != visit.getObject())
+ if (object != diff.getObject())
{
// The object is stale, we need to update the state maybe
}
@@ -123,19 +123,19 @@
List<ObjectUpdate.UpdateObject> updateChildrenUpdates = new ArrayList<ObjectUpdate.UpdateObject>();
//
- for (ObjectVisit addedObjectVisit : addedObjects)
+ for (ObjectDiff addedObjectDiff : addedObjects)
{
- ObjectUpdate childUpdate = createUpdate(addedObjectVisit);
+ ObjectUpdate childUpdate = createUpdate(addedObjectDiff);
//
if (childUpdate instanceof ObjectUpdate.AddObject)
{
- addedChildrenUpdates.add(new ObjectUpdate.AddChild(visit.getObjectId(), (ObjectUpdate.AddObject)childUpdate));
- childrenStatus.put(addedObjectVisit.getObjectId(), true);
+ addedChildrenUpdates.add(new ObjectUpdate.AddChild(diff.getObjectId(), (ObjectUpdate.AddObject)childUpdate));
+ childrenStatus.put(addedObjectDiff.getObjectId(), true);
}
else if (childUpdate == null)
{
- childrenStatus.put(addedObjectVisit.getObjectId(), false);
+ childrenStatus.put(addedObjectDiff.getObjectId(), false);
}
else if (childUpdate instanceof ObjectUpdate.UpdateObject)
{
@@ -145,27 +145,27 @@
//
ObjectUpdate.AddObject addObjectUpdate = new ObjectUpdate.AddObject(
- addedObjectVisit.getObject(),
+ addedObjectDiff.getObject(),
updateChildUpdate.childrenStatus,
updateChildUpdate.addedChildrenUpdates,
updateChildUpdate.removedChildrenUpdates,
updateChildUpdate.updateChildrenUpdates);
//
- ObjectUpdate.AddChild addChildUpdate = new ObjectUpdate.AddChild(visit.getObjectId(), addObjectUpdate);
+ ObjectUpdate.AddChild addChildUpdate = new ObjectUpdate.AddChild(diff.getObjectId(), addObjectUpdate);
//
- if (removedChildren.contains(addedObjectVisit.getObjectId()))
+ if (removedChildren.contains(addedObjectDiff.getObjectId()))
{
addedChildrenUpdates.add(addChildUpdate);
}
else
{
- deferredAddChildUpdates.put(addedObjectVisit.getObjectId(), addChildUpdate);
+ deferredAddChildUpdates.put(addedObjectDiff.getObjectId(), addChildUpdate);
}
//
- childrenStatus.put(addedObjectVisit.getObjectId(), true);
+ childrenStatus.put(addedObjectDiff.getObjectId(), true);
}
else
{
@@ -174,39 +174,39 @@
}
//
- for (ObjectVisit removedChildVisit : removedObjects)
+ for (ObjectDiff removedChildDiff : removedObjects)
{
- removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), createRemove((ObjectVisit.Evict)removedChildVisit)));
+ removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(diff.getObjectId(), createRemove((ObjectDiff.Evict)removedChildDiff)));
}
- List<ObjectVisit> existingObjectVisits = new ArrayList<ObjectVisit>();
- existingObjectVisits.addAll(validObjects);
- existingObjectVisits.addAll(staleObjects);
+ List<ObjectDiff> existingObjectDiffs = new ArrayList<ObjectDiff>();
+ existingObjectDiffs.addAll(validObjects);
+ existingObjectDiffs.addAll(staleObjects);
//
- for (ObjectVisit validObjectVisit : existingObjectVisits)
+ for (ObjectDiff validObjectDiff : existingObjectDiffs)
{
- ObjectUpdate childUpdate = createUpdate(validObjectVisit);
+ ObjectUpdate childUpdate = createUpdate(validObjectDiff);
//
if (childUpdate == null)
{
- childrenStatus.put(validObjectVisit.getObjectId(), false);
+ childrenStatus.put(validObjectDiff.getObjectId(), false);
}
else if (childUpdate instanceof ObjectUpdate.UpdateObject)
{
updateChildrenUpdates.add((ObjectUpdate.UpdateObject)childUpdate);
- childrenStatus.put(validObjectVisit.getObjectId(), true);
+ childrenStatus.put(validObjectDiff.getObjectId(), true);
}
else if (childUpdate instanceof ObjectUpdate.RemoveObject)
{
- removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), (ObjectUpdate.RemoveObject)childUpdate));
- childrenStatus.put(validObjectVisit.getObjectId(), false);
+ removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(diff.getObjectId(), (ObjectUpdate.RemoveObject)childUpdate));
+ childrenStatus.put(validObjectDiff.getObjectId(), false);
}
else if (childUpdate instanceof ObjectUpdate.AddObject)
{
- addedChildrenUpdates.add(new ObjectUpdate.AddChild(visit.getObjectId(), (ObjectUpdate.AddObject)childUpdate));
- childrenStatus.put(validObjectVisit.getObjectId(), true);
+ addedChildrenUpdates.add(new ObjectUpdate.AddChild(diff.getObjectId(), (ObjectUpdate.AddObject)childUpdate));
+ childrenStatus.put(validObjectDiff.getObjectId(), true);
}
else
{
@@ -233,25 +233,25 @@
else
{
return new ObjectUpdate.AddObject(
- visit.getObject(),
+ diff.getObject(),
childrenStatus,
addedChildrenUpdates,
removedChildrenUpdates,
updateChildrenUpdates);
}
}
- else if (visit instanceof ObjectVisit.Load)
+ else if (diff instanceof ObjectDiff.Load)
{
- return new ObjectUpdate.AddObject(visit.getObject());
+ return new ObjectUpdate.AddObject(diff.getObject());
}
- else if (visit instanceof ObjectVisit.SingleUpdate)
+ else if (diff instanceof ObjectDiff.SingleUpdate)
{
List<ObjectUpdate.RemoveChild> removedChildrenUpdates = new ArrayList<ObjectUpdate.RemoveChild>();
//
- for (ObjectVisit.Evict evict : ((ObjectVisit.SingleUpdate)visit).getEvictedChildren())
+ for (ObjectDiff.Evict evict : ((ObjectDiff.SingleUpdate)diff).getEvictedChildren())
{
- removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), createRemove(evict)));
+ removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(diff.getObjectId(), createRemove(evict)));
}
//
@@ -263,7 +263,7 @@
//
return new ObjectUpdate.UpdateObject(object.getStructuralObject(), removedChildrenUpdates);
}
- else if (visit instanceof ObjectVisit.Skip)
+ else if (diff instanceof ObjectDiff.Skip)
{
if (object != null)
{
@@ -273,7 +273,7 @@
//
return null;
}
- else if (visit instanceof ObjectVisit.Evict)
+ else if (diff instanceof ObjectDiff.Evict)
{
if (object == null)
{
@@ -281,20 +281,20 @@
}
//
- return createRemove((ObjectVisit.Evict)visit);
+ return createRemove((ObjectDiff.Evict)diff);
}
else
{
- throw new AssertionError("Cannot execute visit of " + visit);
+ throw new AssertionError("Cannot execute visit of " + diff);
}
}
- private ObjectUpdate.RemoveObject createRemove(ObjectVisit.Evict evict)
+ private ObjectUpdate.RemoveObject createRemove(ObjectDiff.Evict evict)
{
List<ObjectUpdate.RemoveObject> removedChildrenUpdates = new ArrayList<ObjectUpdate.RemoveObject>();
//
- for (ObjectVisit.Evict evictedChild : evict.evictedChildren)
+ for (ObjectDiff.Evict evictedChild : evict.evictedChildren)
{
removedChildrenUpdates.add(createRemove(evictedChild));
}
Copied: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectDiff.java (from rev 11306, modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java)
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectDiff.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectDiff.java 2008-07-06 20:37:56 UTC (rev 11307)
@@ -0,0 +1,339 @@
+/******************************************************************************
+ * 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.impl.model;
+
+import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.Collection;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class ObjectDiff
+{
+
+ static ObjectDiff.Evict createEvict(UIObjectImpl object, Collection<Evict> evictedChildren)
+ {
+ return new Evict(object, evictedChildren);
+ }
+
+ static RecursiveLoad createRecursiveLoad(UIObjectImpl object, Collection<ObjectDiff> addedChildren)
+ {
+ return new RecursiveLoad(object, addedChildren);
+ }
+
+ static ObjectDiff createLoad(UIObjectImpl object)
+ {
+ return new Load(object);
+ }
+
+ static ObjectDiff createSkip(UIObjectImpl object)
+ {
+ return new Skip(object);
+ }
+
+ static SingleUpdate createSingleUpdate(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
+ Collection<Evict> evictedChildren)
+ {
+ return new SingleUpdate(object, removedProperties, updatedProperties, addedProperties, evictedChildren);
+ }
+
+ static RecursiveUpdate createRecursiveUpdate(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
+ Collection<ObjectDiff> addedChildren,
+ Collection<ObjectDiff> validChildren,
+ Collection<ObjectDiff> staleChildren,
+ Collection<ObjectDiff> removedChildren)
+ {
+ return new RecursiveUpdate(
+ object,
+ removedProperties,
+ updatedProperties,
+ addedProperties,
+ addedChildren,
+ validChildren,
+ staleChildren,
+ removedChildren);
+ }
+
+ /** . */
+ private final UIObjectImpl object;
+
+ private ObjectDiff(UIObjectImpl object)
+ {
+ if (object == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.object = object;
+ }
+
+ public String getObjectId()
+ {
+ return object.getId();
+ }
+
+ public UIObjectImpl getObject()
+ {
+ return object;
+ }
+
+ public static class Skip extends ObjectDiff
+ {
+ private Skip(UIObjectImpl object)
+ {
+ super(object);
+ }
+ }
+
+ public static class Load extends ObjectDiff
+ {
+
+ private Load(UIObjectImpl object)
+ {
+ super(object);
+ }
+ }
+
+ public static class RecursiveLoad extends Load
+ {
+
+ /** . */
+ private final Collection<ObjectDiff> addedChildren;
+
+ private RecursiveLoad(
+ UIObjectImpl object,
+ Collection<ObjectDiff> addedChildren)
+ {
+ super(object);
+
+ //
+ if (addedChildren == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ for (ObjectDiff addedChild : addedChildren)
+ {
+ if (!(addedChild instanceof Skip || addedChild instanceof Load))
+ {
+ throw new AssertionError("Cannot accept added child " + addedChild);
+ }
+ }
+
+ //
+ this.addedChildren = addedChildren;
+ }
+
+ public Collection<ObjectDiff> getAddedChildren()
+ {
+ return addedChildren;
+ }
+ }
+
+ public static class RecursiveUpdate extends Update
+ {
+
+ /** . */
+ private final Collection<ObjectDiff> addedChildren;
+
+ /** . */
+ private final Collection<ObjectDiff> validChildren;
+
+ /** . */
+ private final Collection<ObjectDiff> staleChildren;
+
+ /** . */
+ private final Collection<ObjectDiff> removedChildren;
+
+ private RecursiveUpdate(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
+ Collection<ObjectDiff> addedChildren,
+ Collection<ObjectDiff> validChildren,
+ Collection<ObjectDiff> staleChildren,
+ Collection<ObjectDiff> removedChildren)
+ {
+ super(
+ object,
+ removedProperties,
+ updatedProperties,
+ addedProperties);
+
+ //
+ if (addedChildren == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (validChildren == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (staleChildren == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (removedChildren == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ for (ObjectDiff addedChild : addedChildren)
+ {
+ if (!(addedChild instanceof Evict || addedChild instanceof Load))
+ {
+ throw new AssertionError();
+ }
+ }
+
+ //
+ this.addedChildren = addedChildren;
+ this.validChildren = validChildren;
+ this.staleChildren = staleChildren;
+ this.removedChildren = removedChildren;
+ }
+
+ public Collection<ObjectDiff> getAddedChildren()
+ {
+ return addedChildren;
+ }
+
+ public Collection<ObjectDiff> getValidChildren()
+ {
+ return validChildren;
+ }
+
+ public Collection<ObjectDiff> getStaleChildren()
+ {
+ return staleChildren;
+ }
+
+ public Collection<ObjectDiff> getRemovedChildren()
+ {
+ return removedChildren;
+ }
+ }
+
+ public static class SingleUpdate extends Update
+ {
+
+ /** . */
+ private final Collection<Evict> evictedChildren;
+
+ public SingleUpdate(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
+ Collection<Evict> evictedChildren)
+ {
+ super(
+ object,
+ removedProperties,
+ updatedProperties,
+ addedProperties);
+
+ //
+ this.evictedChildren = evictedChildren;
+ }
+
+ public Collection<Evict> getEvictedChildren()
+ {
+ return evictedChildren;
+ }
+ }
+
+ public static class Update extends ObjectDiff
+ {
+
+ /** . */
+ private final Set<String> removedProperties;
+
+ /** . */
+ private final Map<String, Serializable> updatedProperties;
+
+ /** . */
+ private final Map<String, Serializable> addedProperties;
+
+ private Update(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties)
+ {
+ super(object);
+
+ //
+ this.removedProperties = removedProperties;
+ this.updatedProperties = updatedProperties;
+ this.addedProperties = addedProperties;
+ }
+
+ public Set<String> getRemovedProperties()
+ {
+ return removedProperties;
+ }
+
+ public Map<String, Serializable> getUpdatedProperties()
+ {
+ return updatedProperties;
+ }
+
+ public Map<String, Serializable> getAddedProperties()
+ {
+ return addedProperties;
+ }
+ }
+
+ public static class Evict extends ObjectDiff
+ {
+
+ /** . */
+ final Collection<Evict> evictedChildren;
+
+ public Evict(UIObjectImpl object, Collection<Evict> evictedChildren)
+ {
+ super(object);
+
+ //
+ this.evictedChildren = evictedChildren;
+ }
+ }
+}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ViewPortImpl.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ViewPortImpl.java 2008-07-06 20:35:49 UTC (rev 11306)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ViewPortImpl.java 2008-07-06 20:37:56 UTC (rev 11307)
@@ -57,10 +57,10 @@
createDiffPhase.perform();
//
- ObjectVisit rootVisit = createDiffPhase.getRootVisit();
+ ObjectDiff rootDiff = createDiffPhase.getRootVisit();
//
- CreateUpdatePhase createUpdatePhase = new CreateUpdatePhase(context, rootVisit);
+ CreateUpdatePhase createUpdatePhase = new CreateUpdatePhase(context, rootDiff);
//
createUpdatePhase.perform();
16 years
JBoss Portal SVN: r11306 - modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-06 16:35:49 -0400 (Sun, 06 Jul 2008)
New Revision: 11306
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
Log:
simplify a bit
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:31:36 UTC (rev 11305)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:35:49 UTC (rev 11306)
@@ -159,19 +159,7 @@
//
for (StructuralObject addedStructuralChild : refresh.getAddedChildren())
{
- ObjectVisit childVisit = load(addedStructuralChild);
- if (childVisit instanceof ObjectVisit.Load)
- {
- addedObjects.add(childVisit);
- }
- else if (childVisit instanceof ObjectVisit.Skip)
- {
- addedObjects.add(childVisit);
- }
- else
- {
- throw new AssertionError();
- }
+ addedObjects.add(load(addedStructuralChild));
}
//
@@ -259,19 +247,7 @@
Collection<ObjectVisit> addedChildren = new ArrayList<ObjectVisit>();
for (StructuralObject structuralChild : structuralStateContext.loadChildren(structuralObject))
{
- ObjectVisit childVisit = load(structuralChild);
- if (childVisit instanceof ObjectVisit.Load)
- {
- addedChildren.add(childVisit);
- }
- else if (childVisit instanceof ObjectVisit.Skip)
- {
- addedChildren.add(childVisit);
- }
- else
- {
- throw new AssertionError();
- }
+ addedChildren.add(load(structuralChild));
}
return ObjectVisit.createRecursiveLoad(object, addedChildren);
}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-06 20:31:36 UTC (rev 11305)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-06 20:35:49 UTC (rev 11306)
@@ -147,13 +147,13 @@
}
//
-// for (ObjectVisit addedChild : addedChildren)
-// {
-// if (!(addedChild instanceof Evict || addedChild instanceof Load))
-// {
-// throw new AssertionError();
-// }
-// }
+ for (ObjectVisit addedChild : addedChildren)
+ {
+ if (!(addedChild instanceof Skip || addedChild instanceof Load))
+ {
+ throw new AssertionError("Cannot accept added child " + addedChild);
+ }
+ }
//
this.addedChildren = addedChildren;
@@ -215,6 +215,15 @@
}
//
+ for (ObjectVisit addedChild : addedChildren)
+ {
+ if (!(addedChild instanceof Evict || addedChild instanceof Load))
+ {
+ throw new AssertionError();
+ }
+ }
+
+ //
this.addedChildren = addedChildren;
this.validChildren = validChildren;
this.staleChildren = staleChildren;
16 years
JBoss Portal SVN: r11305 - modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-06 16:31:36 -0400 (Sun, 06 Jul 2008)
New Revision: 11305
Removed:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ChildrenVisit.java
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
Log:
simplify a bit
Deleted: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ChildrenVisit.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ChildrenVisit.java 2008-07-06 20:05:38 UTC (rev 11304)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ChildrenVisit.java 2008-07-06 20:31:36 UTC (rev 11305)
@@ -1,70 +0,0 @@
-/******************************************************************************
- * 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.impl.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ChildrenVisit
-{
-
- /** . */
- final Collection<ObjectVisit> addedObjects = new ArrayList<ObjectVisit>();
-
- /** . */
- final Collection<ObjectVisit> validObjects = new ArrayList<ObjectVisit>();
-
- /** . */
- final Collection<ObjectVisit> staleObjects = new ArrayList<ObjectVisit>();
-
- /** . */
- final Collection<ObjectVisit> removedObjects = new ArrayList<ObjectVisit>();
-
- ChildrenVisit()
- {
- }
-
- public Collection<ObjectVisit> getAddedObjects()
- {
- return addedObjects;
- }
-
- public Collection<ObjectVisit> getRemovedObjects()
- {
- return removedObjects;
- }
-
- public Collection<ObjectVisit> getValidObjects()
- {
- return validObjects;
- }
-
- public Collection<ObjectVisit> getStaleObjects()
- {
- return staleObjects;
- }
-}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:05:38 UTC (rev 11304)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:31:36 UTC (rev 11305)
@@ -151,7 +151,10 @@
//
if (traversalType == ObjectTraversalType.RECURSIVE)
{
- ChildrenVisit childrenVisit = new ChildrenVisit();
+ Collection<ObjectVisit> addedObjects = new ArrayList<ObjectVisit>();
+ Collection<ObjectVisit> validObjects = new ArrayList<ObjectVisit>();
+ Collection<ObjectVisit> staleObjects = new ArrayList<ObjectVisit>();
+ Collection<ObjectVisit> removedObjects = new ArrayList<ObjectVisit>();
//
for (StructuralObject addedStructuralChild : refresh.getAddedChildren())
@@ -159,11 +162,11 @@
ObjectVisit childVisit = load(addedStructuralChild);
if (childVisit instanceof ObjectVisit.Load)
{
- childrenVisit.addedObjects.add(childVisit);
+ addedObjects.add(childVisit);
}
else if (childVisit instanceof ObjectVisit.Skip)
{
- childrenVisit.addedObjects.add(childVisit);
+ addedObjects.add(childVisit);
}
else
{
@@ -175,14 +178,14 @@
for (StructuralObject staleStructuralChild : refresh.getStaleChildren().values())
{
ObjectVisit childVisit = diff(staleStructuralChild.getId());
- childrenVisit.staleObjects.add(childVisit);
+ staleObjects.add(childVisit);
}
//
for (String validChildId : refresh.getValidChildren())
{
ObjectVisit childVisit = diff(validChildId);
- childrenVisit.validObjects.add(childVisit);
+ validObjects.add(childVisit);
}
//
@@ -194,7 +197,7 @@
if (removedChild != null)
{
ObjectVisit.Evict childVisit = createEvict(removedChild);
- childrenVisit.removedObjects.add(childVisit);
+ removedObjects.add(childVisit);
}
else
{
@@ -209,7 +212,10 @@
refresh.getRemovedProperties(),
refresh.getUpdatedProperties(),
refresh.getAddedProperties(),
- childrenVisit);
+ addedObjects,
+ validObjects,
+ staleObjects,
+ removedObjects);
}
else
{
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-07-06 20:05:38 UTC (rev 11304)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-07-06 20:31:36 UTC (rev 11305)
@@ -31,6 +31,8 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Collection;
+import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -86,15 +88,23 @@
if (visit instanceof ObjectVisit.RecursiveLoad || visit instanceof ObjectVisit.RecursiveUpdate)
{
- ChildrenVisit childrenVisit;
+ Collection<ObjectVisit> addedObjects;
+ Collection<ObjectVisit> validObjects;
+ Collection<ObjectVisit> staleObjects;
+ Collection<ObjectVisit> removedObjects;
if (visit instanceof ObjectVisit.RecursiveUpdate)
{
- childrenVisit = ((ObjectVisit.RecursiveUpdate)visit).getChildrenVisit();
+ addedObjects = ((ObjectVisit.RecursiveUpdate)visit).getAddedChildren();
+ validObjects = ((ObjectVisit.RecursiveUpdate)visit).getValidChildren();
+ staleObjects = ((ObjectVisit.RecursiveUpdate)visit).getStaleChildren();
+ removedObjects = ((ObjectVisit.RecursiveUpdate)visit).getRemovedChildren();
}
else
{
- childrenVisit = new ChildrenVisit();
- childrenVisit.addedObjects.addAll(((ObjectVisit.RecursiveLoad)visit).getAddedChildren());
+ addedObjects = ((ObjectVisit.RecursiveLoad)visit).getAddedChildren();
+ validObjects = Collections.emptyList();
+ staleObjects = Collections.emptyList();
+ removedObjects = Collections.emptyList();
}
//
@@ -113,7 +123,7 @@
List<ObjectUpdate.UpdateObject> updateChildrenUpdates = new ArrayList<ObjectUpdate.UpdateObject>();
//
- for (ObjectVisit addedObjectVisit : childrenVisit.getAddedObjects())
+ for (ObjectVisit addedObjectVisit : addedObjects)
{
ObjectUpdate childUpdate = createUpdate(addedObjectVisit);
@@ -164,14 +174,14 @@
}
//
- for (ObjectVisit removedChildVisit : childrenVisit.getRemovedObjects())
+ for (ObjectVisit removedChildVisit : removedObjects)
{
removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), createRemove((ObjectVisit.Evict)removedChildVisit)));
}
List<ObjectVisit> existingObjectVisits = new ArrayList<ObjectVisit>();
- existingObjectVisits.addAll(childrenVisit.getValidObjects());
- existingObjectVisits.addAll(childrenVisit.getStaleObjects());
+ existingObjectVisits.addAll(validObjects);
+ existingObjectVisits.addAll(staleObjects);
//
for (ObjectVisit validObjectVisit : existingObjectVisits)
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-06 20:05:38 UTC (rev 11304)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-06 20:31:36 UTC (rev 11305)
@@ -71,9 +71,20 @@
Set<String> removedProperties,
Map<String, Serializable> updatedProperties,
Map<String, Serializable> addedProperties,
- ChildrenVisit children)
+ Collection<ObjectVisit> addedChildren,
+ Collection<ObjectVisit> validChildren,
+ Collection<ObjectVisit> staleChildren,
+ Collection<ObjectVisit> removedChildren)
{
- return new RecursiveUpdate(object, removedProperties, updatedProperties, addedProperties, children);
+ return new RecursiveUpdate(
+ object,
+ removedProperties,
+ updatedProperties,
+ addedProperties,
+ addedChildren,
+ validChildren,
+ staleChildren,
+ removedChildren);
}
/** . */
@@ -121,7 +132,7 @@
{
/** . */
- final Collection<ObjectVisit> addedChildren;
+ private final Collection<ObjectVisit> addedChildren;
private RecursiveLoad(
UIObjectImpl object,
@@ -136,6 +147,15 @@
}
//
+// for (ObjectVisit addedChild : addedChildren)
+// {
+// if (!(addedChild instanceof Evict || addedChild instanceof Load))
+// {
+// throw new AssertionError();
+// }
+// }
+
+ //
this.addedChildren = addedChildren;
}
@@ -149,14 +169,26 @@
{
/** . */
- private final ChildrenVisit children;
+ private final Collection<ObjectVisit> addedChildren;
+ /** . */
+ private final Collection<ObjectVisit> validChildren;
+
+ /** . */
+ private final Collection<ObjectVisit> staleChildren;
+
+ /** . */
+ private final Collection<ObjectVisit> removedChildren;
+
private RecursiveUpdate(
UIObjectImpl object,
Set<String> removedProperties,
Map<String, Serializable> updatedProperties,
Map<String, Serializable> addedProperties,
- ChildrenVisit children)
+ Collection<ObjectVisit> addedChildren,
+ Collection<ObjectVisit> validChildren,
+ Collection<ObjectVisit> staleChildren,
+ Collection<ObjectVisit> removedChildren)
{
super(
object,
@@ -165,19 +197,49 @@
addedProperties);
//
- if (children == null)
+ if (addedChildren == null)
{
throw new IllegalArgumentException();
}
+ if (validChildren == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (staleChildren == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (removedChildren == null)
+ {
+ throw new IllegalArgumentException();
+ }
//
- this.children = children;
+ this.addedChildren = addedChildren;
+ this.validChildren = validChildren;
+ this.staleChildren = staleChildren;
+ this.removedChildren = removedChildren;
}
- public ChildrenVisit getChildrenVisit()
+ public Collection<ObjectVisit> getAddedChildren()
{
- return children;
+ return addedChildren;
}
+
+ public Collection<ObjectVisit> getValidChildren()
+ {
+ return validChildren;
+ }
+
+ public Collection<ObjectVisit> getStaleChildren()
+ {
+ return staleChildren;
+ }
+
+ public Collection<ObjectVisit> getRemovedChildren()
+ {
+ return removedChildren;
+ }
}
public static class SingleUpdate extends Update
16 years
JBoss Portal SVN: r11304 - modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-06 16:05:38 -0400 (Sun, 06 Jul 2008)
New Revision: 11304
Added:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildRecursiveTestCase.java
Log:
recursive removal test case
Added: modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildRecursiveTestCase.java
===================================================================
--- modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildRecursiveTestCase.java (rev 0)
+++ modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildRecursiveTestCase.java 2008-07-06 20:05:38 UTC (rev 11304)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * 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.test.model;
+
+import org.jboss.portal.presentation.model.ObjectTraversalType;
+import org.jboss.portal.presentation.model.ViewPort;
+import org.jboss.portal.presentation.model.ViewPortScope;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class RemoveChildRecursiveTestCase extends TraversalModelTestCase
+{
+
+ public void testRemoveChild()
+ {
+ test(3, null);
+ }
+
+ protected void test(ObjectTraversalType[] before, ObjectTraversalType[] after, Object handback)
+ {
+ NodeDef rootDef = NodeDef.create(context);
+ NodeDef fooDef = rootDef.addChild("foo");
+ NodeDef barDef = fooDef.addChild("bar");
+ NodeDef juuDef = barDef.addChild("juu");
+
+ //
+ fooDef.setTraversal(before[0]);
+ barDef.setTraversal(before[1]);
+ juuDef.setTraversal(before[2]);
+
+ //
+ rootDef.populate(mockModel);
+
+ //
+ ViewPortScope scope = new CustomScope(mockModel, model, rootDef);
+ UIObjectTree context = new UIObjectTree();
+ ViewPort viewPort = model.createViewPort(context, scope);
+
+ //
+ viewPort.refresh();
+ rootDef.assertEquals(context.getNode(model.getRootId()));
+
+ //
+ mockModel.destroy(mockModel.getRoot().getChild("foo").getChild("bar"));
+ fooDef.removeChild("bar");
+
+ //
+ fooDef.setTraversal(after[0]);
+ barDef.setTraversal(after[1]);
+ juuDef.setTraversal(after[2]);
+
+ //
+ viewPort.refresh();
+ rootDef.assertEquals(context.getNode(model.getRootId()));
+ context.assertConsistency(model.getRootId());
+ }
+}
\ No newline at end of file
16 years
JBoss Portal SVN: r11303 - in modules/presentation/trunk/presentation/src: test/java/org/jboss/portal/presentation/test/model and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-06 16:00:43 -0400 (Sun, 06 Jul 2008)
New Revision: 11303
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildTestCase.java
Log:
implement and test the case where a child was not loaded and it is removed and loaded in the next refresh
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 15:11:34 UTC (rev 11302)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 20:00:43 UTC (rev 11303)
@@ -103,8 +103,6 @@
private ObjectVisit.Evict createEvict(UIObjectImpl object)
{
-
- //
Collection<ObjectVisit.Evict> evictedChildren = createEvictedChildren(object);
//
@@ -159,7 +157,18 @@
for (StructuralObject addedStructuralChild : refresh.getAddedChildren())
{
ObjectVisit childVisit = load(addedStructuralChild);
- childrenVisit.addedObjects.add(childVisit);
+ if (childVisit instanceof ObjectVisit.Load)
+ {
+ childrenVisit.addedObjects.add(childVisit);
+ }
+ else if (childVisit instanceof ObjectVisit.Skip)
+ {
+ childrenVisit.addedObjects.add(childVisit);
+ }
+ else
+ {
+ throw new AssertionError();
+ }
}
//
@@ -180,8 +189,18 @@
for (String removedChildId : refresh.getRemovedChildren())
{
UIObjectImpl removedChild = (UIObjectImpl)context.getObject(removedChildId);
- ObjectVisit childVisit = createEvict(removedChild);
- childrenVisit.removedObjects.add(childVisit);
+
+ //
+ if (removedChild != null)
+ {
+ ObjectVisit.Evict childVisit = createEvict(removedChild);
+ childrenVisit.removedObjects.add(childVisit);
+ }
+ else
+ {
+ // It means that the child was not loaded previously and it has
+ // been removed in the current refresh, so we do nothing
+ }
}
//
@@ -229,18 +248,26 @@
}
else
{
- ChildrenVisit childrenVisit = null;
-
- //
if (traversalType == ObjectTraversalType.RECURSIVE)
{
- childrenVisit = new ChildrenVisit();
+ Collection<ObjectVisit> addedChildren = new ArrayList<ObjectVisit>();
for (StructuralObject structuralChild : structuralStateContext.loadChildren(structuralObject))
{
ObjectVisit childVisit = load(structuralChild);
- childrenVisit.addedObjects.add(childVisit);
+ if (childVisit instanceof ObjectVisit.Load)
+ {
+ addedChildren.add(childVisit);
+ }
+ else if (childVisit instanceof ObjectVisit.Skip)
+ {
+ addedChildren.add(childVisit);
+ }
+ else
+ {
+ throw new AssertionError();
+ }
}
- return ObjectVisit.createRecursiveLoad(object, childrenVisit);
+ return ObjectVisit.createRecursiveLoad(object, addedChildren);
}
else
{
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-07-06 15:11:34 UTC (rev 11302)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-07-06 20:00:43 UTC (rev 11303)
@@ -86,7 +86,16 @@
if (visit instanceof ObjectVisit.RecursiveLoad || visit instanceof ObjectVisit.RecursiveUpdate)
{
- ChildrenVisit childrenVisit = visit instanceof ObjectVisit.Load ? ((ObjectVisit.RecursiveLoad)visit).getChildrenVisit() : ((ObjectVisit.RecursiveUpdate)visit).getChildrenVisit();
+ ChildrenVisit childrenVisit;
+ if (visit instanceof ObjectVisit.RecursiveUpdate)
+ {
+ childrenVisit = ((ObjectVisit.RecursiveUpdate)visit).getChildrenVisit();
+ }
+ else
+ {
+ childrenVisit = new ChildrenVisit();
+ childrenVisit.addedObjects.addAll(((ObjectVisit.RecursiveLoad)visit).getAddedChildren());
+ }
//
if (object != null)
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-06 15:11:34 UTC (rev 11302)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-06 20:00:43 UTC (rev 11303)
@@ -41,9 +41,9 @@
return new Evict(object, evictedChildren);
}
- static RecursiveLoad createRecursiveLoad(UIObjectImpl object, ChildrenVisit children)
+ static RecursiveLoad createRecursiveLoad(UIObjectImpl object, Collection<ObjectVisit> addedChildren)
{
- return new RecursiveLoad(object, children);
+ return new RecursiveLoad(object, addedChildren);
}
static ObjectVisit createLoad(UIObjectImpl object)
@@ -121,25 +121,27 @@
{
/** . */
- private final ChildrenVisit children;
+ final Collection<ObjectVisit> addedChildren;
- private RecursiveLoad(UIObjectImpl object, ChildrenVisit children)
+ private RecursiveLoad(
+ UIObjectImpl object,
+ Collection<ObjectVisit> addedChildren)
{
super(object);
//
- if (children == null)
+ if (addedChildren == null)
{
throw new IllegalArgumentException();
}
//
- this.children = children;
+ this.addedChildren = addedChildren;
}
- public ChildrenVisit getChildrenVisit()
+ public Collection<ObjectVisit> getAddedChildren()
{
- return children;
+ return addedChildren;
}
}
Modified: modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildTestCase.java
===================================================================
--- modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildTestCase.java 2008-07-06 15:11:34 UTC (rev 11302)
+++ modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildTestCase.java 2008-07-06 20:00:43 UTC (rev 11303)
@@ -46,6 +46,9 @@
NodeDef juuDef = fooDef.addChild("juu");
//
+ juuDef.setTraversal(before[0]);
+
+ //
rootDef.populate(mockModel);
//
16 years
JBoss Portal SVN: r11302 - modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-06 11:11:34 -0400 (Sun, 06 Jul 2008)
New Revision: 11302
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ChildrenVisit.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
Log:
improvement
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ChildrenVisit.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ChildrenVisit.java 2008-07-04 15:32:27 UTC (rev 11301)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ChildrenVisit.java 2008-07-06 15:11:34 UTC (rev 11302)
@@ -42,7 +42,7 @@
final Collection<ObjectVisit> staleObjects = new ArrayList<ObjectVisit>();
/** . */
- final Collection<String> removedObjects = new ArrayList<String>();
+ final Collection<ObjectVisit> removedObjects = new ArrayList<ObjectVisit>();
ChildrenVisit()
{
@@ -53,7 +53,7 @@
return addedObjects;
}
- public Collection<String> getRemovedObjects()
+ public Collection<ObjectVisit> getRemovedObjects()
{
return removedObjects;
}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-04 15:32:27 UTC (rev 11301)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-06 15:11:34 UTC (rev 11302)
@@ -30,6 +30,9 @@
import org.jboss.portal.presentation.state.structural.StructuralStateContext;
import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
+import java.util.Collection;
+import java.util.ArrayList;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -98,6 +101,40 @@
}
}
+ private ObjectVisit.Evict createEvict(UIObjectImpl object)
+ {
+
+ //
+ Collection<ObjectVisit.Evict> evictedChildren = createEvictedChildren(object);
+
+ //
+ return ObjectVisit.createEvict(object, evictedChildren);
+ }
+
+ private Collection<ObjectVisit.Evict> createEvictedChildren(UIObjectImpl object)
+ {
+ Collection<ObjectVisit.Evict> evictedChildren = new ArrayList<ObjectVisit.Evict>();
+
+ //
+ InternalObjectContext objectContext = (InternalObjectContext)object.getContext();
+
+ //
+ if (objectContext.childRefs != null)
+ {
+ for (UIObjectRef removedChildRef : objectContext.childRefs.values())
+ {
+ if (removedChildRef.loaded)
+ {
+ UIObjectImpl child = (UIObjectImpl)context.getObject(removedChildRef.getId());
+
+ //
+ evictedChildren.add(createEvict(child));
+ }
+ }
+ }
+ return evictedChildren;
+ }
+
private ObjectVisit diff(UIObjectImpl object)
{
ObjectTraversalType traversalType = scope.enterObject(object);
@@ -107,17 +144,16 @@
{
if (traversalType == ObjectTraversalType.SKIP)
{
- return ObjectVisit.createEvict(object);
+ return createEvict(object);
}
else
{
StructuralObject.Refresh refresh = structuralStateContext.refresh(object.getStructuralObject());
//
- ChildrenVisit childrenVisit = null;
if (traversalType == ObjectTraversalType.RECURSIVE)
{
- childrenVisit = new ChildrenVisit();
+ ChildrenVisit childrenVisit = new ChildrenVisit();
//
for (StructuralObject addedStructuralChild : refresh.getAddedChildren())
@@ -141,16 +177,34 @@
}
//
- childrenVisit.removedObjects.addAll(refresh.getRemovedChildren());
+ for (String removedChildId : refresh.getRemovedChildren())
+ {
+ UIObjectImpl removedChild = (UIObjectImpl)context.getObject(removedChildId);
+ ObjectVisit childVisit = createEvict(removedChild);
+ childrenVisit.removedObjects.add(childVisit);
+ }
+
+ //
+ return ObjectVisit.createRecursiveUpdate(
+ object,
+ refresh.getRemovedProperties(),
+ refresh.getUpdatedProperties(),
+ refresh.getAddedProperties(),
+ childrenVisit);
}
+ else
+ {
- //
- return ObjectVisit.createUpdate(
- object,
- refresh.getRemovedProperties(),
- refresh.getUpdatedProperties(),
- refresh.getAddedProperties(),
- childrenVisit);
+ Collection<ObjectVisit.Evict> evictedChildren = createEvictedChildren(object);
+
+ //
+ return ObjectVisit.createSingleUpdate(
+ object,
+ refresh.getRemovedProperties(),
+ refresh.getUpdatedProperties(),
+ refresh.getAddedProperties(),
+ evictedChildren);
+ }
}
}
finally
@@ -186,10 +240,12 @@
ObjectVisit childVisit = load(structuralChild);
childrenVisit.addedObjects.add(childVisit);
}
+ return ObjectVisit.createRecursiveLoad(object, childrenVisit);
}
-
- //
- return ObjectVisit.createLoad(object, childrenVisit);
+ else
+ {
+ return ObjectVisit.createLoad(object);
+ }
}
}
finally
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-07-04 15:32:27 UTC (rev 11301)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-07-06 15:11:34 UTC (rev 11302)
@@ -84,9 +84,9 @@
{
UIObjectImpl object = (UIObjectImpl)context.getObject(visit.getObjectId());
- if (visit instanceof ObjectVisit.Load || visit instanceof ObjectVisit.Update)
+ if (visit instanceof ObjectVisit.RecursiveLoad || visit instanceof ObjectVisit.RecursiveUpdate)
{
- ChildrenVisit childrenVisit = visit instanceof ObjectVisit.Load ? ((ObjectVisit.Load)visit).getChildrenVisit() : ((ObjectVisit.Update)visit).getChildrenVisit();
+ ChildrenVisit childrenVisit = visit instanceof ObjectVisit.Load ? ((ObjectVisit.RecursiveLoad)visit).getChildrenVisit() : ((ObjectVisit.RecursiveUpdate)visit).getChildrenVisit();
//
if (object != null)
@@ -98,170 +98,151 @@
}
//
- if (childrenVisit != null)
+ Map<String, Boolean> childrenStatus = new HashMap<String, Boolean>();
+ List<ObjectUpdate.AddChild> addedChildrenUpdates = new ArrayList<ObjectUpdate.AddChild>();
+ List<ObjectUpdate.RemoveChild> removedChildrenUpdates = new ArrayList<ObjectUpdate.RemoveChild>();
+ List<ObjectUpdate.UpdateObject> updateChildrenUpdates = new ArrayList<ObjectUpdate.UpdateObject>();
+
+ //
+ for (ObjectVisit addedObjectVisit : childrenVisit.getAddedObjects())
{
- Map<String, Boolean> childrenStatus = new HashMap<String, Boolean>();
- List<ObjectUpdate.AddChild> addedChildrenUpdates = new ArrayList<ObjectUpdate.AddChild>();
- List<ObjectUpdate.RemoveChild> removedChildrenUpdates = new ArrayList<ObjectUpdate.RemoveChild>();
- List<ObjectUpdate.UpdateObject> updateChildrenUpdates = new ArrayList<ObjectUpdate.UpdateObject>();
+ ObjectUpdate childUpdate = createUpdate(addedObjectVisit);
//
- for (ObjectVisit addedObjectVisit : childrenVisit.getAddedObjects())
+ if (childUpdate instanceof ObjectUpdate.AddObject)
{
- ObjectUpdate childUpdate = createUpdate(addedObjectVisit);
+ addedChildrenUpdates.add(new ObjectUpdate.AddChild(visit.getObjectId(), (ObjectUpdate.AddObject)childUpdate));
+ childrenStatus.put(addedObjectVisit.getObjectId(), true);
+ }
+ else if (childUpdate == null)
+ {
+ childrenStatus.put(addedObjectVisit.getObjectId(), false);
+ }
+ else if (childUpdate instanceof ObjectUpdate.UpdateObject)
+ {
+ // This is 'the' trick becaue this is likely a 'move' operation that we may need
+ // to handle differently as a deferred add child
+ ObjectUpdate.UpdateObject updateChildUpdate = (ObjectUpdate.UpdateObject)childUpdate;
//
- if (childUpdate instanceof ObjectUpdate.AddObject)
+ ObjectUpdate.AddObject addObjectUpdate = new ObjectUpdate.AddObject(
+ addedObjectVisit.getObject(),
+ updateChildUpdate.childrenStatus,
+ updateChildUpdate.addedChildrenUpdates,
+ updateChildUpdate.removedChildrenUpdates,
+ updateChildUpdate.updateChildrenUpdates);
+
+ //
+ ObjectUpdate.AddChild addChildUpdate = new ObjectUpdate.AddChild(visit.getObjectId(), addObjectUpdate);
+
+ //
+ if (removedChildren.contains(addedObjectVisit.getObjectId()))
{
- addedChildrenUpdates.add(new ObjectUpdate.AddChild(visit.getObjectId(), (ObjectUpdate.AddObject)childUpdate));
- childrenStatus.put(addedObjectVisit.getObjectId(), true);
+ addedChildrenUpdates.add(addChildUpdate);
}
- else if (childUpdate == null)
+ else
{
- childrenStatus.put(addedObjectVisit.getObjectId(), false);
+ deferredAddChildUpdates.put(addedObjectVisit.getObjectId(), addChildUpdate);
}
- else if (childUpdate instanceof ObjectUpdate.UpdateObject)
- {
- // This is 'the' trick becaue this is likely a 'move' operation that we may need
- // to handle differently as a deferred add child
- ObjectUpdate.UpdateObject updateChildUpdate = (ObjectUpdate.UpdateObject)childUpdate;
- //
- ObjectUpdate.AddObject addObjectUpdate = new ObjectUpdate.AddObject(
- addedObjectVisit.getObject(),
- updateChildUpdate.childrenStatus,
- updateChildUpdate.addedChildrenUpdates,
- updateChildUpdate.removedChildrenUpdates,
- updateChildUpdate.updateChildrenUpdates);
+ //
+ childrenStatus.put(addedObjectVisit.getObjectId(), true);
+ }
+ else
+ {
+ throw new UnsupportedOperationException("Was not expecting update of type " + childUpdate.getClass().getSimpleName());
+ }
+ }
- //
- ObjectUpdate.AddChild addChildUpdate = new ObjectUpdate.AddChild(visit.getObjectId(), addObjectUpdate);
+ //
+ for (ObjectVisit removedChildVisit : childrenVisit.getRemovedObjects())
+ {
+ removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), createRemove((ObjectVisit.Evict)removedChildVisit)));
+ }
- //
- if (removedChildren.contains(addedObjectVisit.getObjectId()))
- {
- addedChildrenUpdates.add(addChildUpdate);
- }
- else
- {
- deferredAddChildUpdates.put(addedObjectVisit.getObjectId(), addChildUpdate);
- }
+ List<ObjectVisit> existingObjectVisits = new ArrayList<ObjectVisit>();
+ existingObjectVisits.addAll(childrenVisit.getValidObjects());
+ existingObjectVisits.addAll(childrenVisit.getStaleObjects());
- //
- childrenStatus.put(addedObjectVisit.getObjectId(), true);
- }
- else
- {
- throw new UnsupportedOperationException("Was not expecting update of type " + childUpdate.getClass().getSimpleName());
- }
- }
+ //
+ for (ObjectVisit validObjectVisit : existingObjectVisits)
+ {
+ ObjectUpdate childUpdate = createUpdate(validObjectVisit);
//
- for (String removeObjectId : childrenVisit.getRemovedObjects())
+ if (childUpdate == null)
{
- UIObjectImpl child = (UIObjectImpl)context.getObject(removeObjectId);
- removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), createRemove(child)));
+ childrenStatus.put(validObjectVisit.getObjectId(), false);
}
-
- List<ObjectVisit> existingObjectVisits = new ArrayList<ObjectVisit>();
- existingObjectVisits.addAll(childrenVisit.getValidObjects());
- existingObjectVisits.addAll(childrenVisit.getStaleObjects());
-
- //
- for (ObjectVisit validObjectVisit : existingObjectVisits)
+ else if (childUpdate instanceof ObjectUpdate.UpdateObject)
{
- ObjectUpdate childUpdate = createUpdate(validObjectVisit);
-
- //
- if (childUpdate == null)
- {
- childrenStatus.put(validObjectVisit.getObjectId(), false);
- }
- else if (childUpdate instanceof ObjectUpdate.UpdateObject)
- {
- updateChildrenUpdates.add((ObjectUpdate.UpdateObject)childUpdate);
- childrenStatus.put(validObjectVisit.getObjectId(), true);
- }
- else if (childUpdate instanceof ObjectUpdate.RemoveObject)
- {
- removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), (ObjectUpdate.RemoveObject)childUpdate));
- childrenStatus.put(validObjectVisit.getObjectId(), false);
- }
- else if (childUpdate instanceof ObjectUpdate.AddObject)
- {
- addedChildrenUpdates.add(new ObjectUpdate.AddChild(visit.getObjectId(), (ObjectUpdate.AddObject)childUpdate));
- childrenStatus.put(validObjectVisit.getObjectId(), true);
- }
- else
- {
- throw new UnsupportedOperationException("Was not expecting update of type " + childUpdate.getClass().getSimpleName());
- }
+ updateChildrenUpdates.add((ObjectUpdate.UpdateObject)childUpdate);
+ childrenStatus.put(validObjectVisit.getObjectId(), true);
}
-
- //
- for (ObjectUpdate.RemoveChild removeChildUpdate : removedChildrenUpdates)
+ else if (childUpdate instanceof ObjectUpdate.RemoveObject)
{
- removedChildren.add(removeChildUpdate.removedObjectUpdate.objectId);
+ removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), (ObjectUpdate.RemoveObject)childUpdate));
+ childrenStatus.put(validObjectVisit.getObjectId(), false);
}
-
- //
- if (object != null)
+ else if (childUpdate instanceof ObjectUpdate.AddObject)
{
- return new ObjectUpdate.UpdateObject(
- object.getStructuralObject(),
- childrenStatus,
- addedChildrenUpdates,
- removedChildrenUpdates,
- updateChildrenUpdates);
+ addedChildrenUpdates.add(new ObjectUpdate.AddChild(visit.getObjectId(), (ObjectUpdate.AddObject)childUpdate));
+ childrenStatus.put(validObjectVisit.getObjectId(), true);
}
else
{
- return new ObjectUpdate.AddObject(
- visit.getObject(),
- childrenStatus,
- addedChildrenUpdates,
- removedChildrenUpdates,
- updateChildrenUpdates);
+ throw new UnsupportedOperationException("Was not expecting update of type " + childUpdate.getClass().getSimpleName());
}
}
+
+ //
+ for (ObjectUpdate.RemoveChild removeChildUpdate : removedChildrenUpdates)
+ {
+ removedChildren.add(removeChildUpdate.removedObjectUpdate.objectId);
+ }
+
+ //
+ if (object != null)
+ {
+ return new ObjectUpdate.UpdateObject(
+ object.getStructuralObject(),
+ childrenStatus,
+ addedChildrenUpdates,
+ removedChildrenUpdates,
+ updateChildrenUpdates);
+ }
else
{
- if (object != null)
- {
- List<ObjectUpdate.RemoveChild> removedChildrenUpdates = new ArrayList<ObjectUpdate.RemoveChild>();
+ return new ObjectUpdate.AddObject(
+ visit.getObject(),
+ childrenStatus,
+ addedChildrenUpdates,
+ removedChildrenUpdates,
+ updateChildrenUpdates);
+ }
+ }
+ else if (visit instanceof ObjectVisit.Load)
+ {
+ return new ObjectUpdate.AddObject(visit.getObject());
+ }
+ else if (visit instanceof ObjectVisit.SingleUpdate)
+ {
+ List<ObjectUpdate.RemoveChild> removedChildrenUpdates = new ArrayList<ObjectUpdate.RemoveChild>();
- //
- InternalObjectContext objectContext = (InternalObjectContext)object.getContext();
+ //
+ for (ObjectVisit.Evict evict : ((ObjectVisit.SingleUpdate)visit).getEvictedChildren())
+ {
+ removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), createRemove(evict)));
+ }
- //
- if (objectContext.childRefs != null)
- {
- for (UIObjectRef removedChildRef : objectContext.childRefs.values())
- {
- if (removedChildRef.loaded)
- {
- UIObjectImpl child = (UIObjectImpl)context.getObject(removedChildRef.getId());
-
- //
- removedChildrenUpdates.add(new ObjectUpdate.RemoveChild(visit.getObjectId(), createRemove(child)));
- }
- }
- }
-
- //
- for (ObjectUpdate.RemoveChild removeChildUpdate : removedChildrenUpdates)
- {
- removedChildren.add(removeChildUpdate.removedObjectUpdate.objectId);
- }
-
- //
- return new ObjectUpdate.UpdateObject(object.getStructuralObject(), removedChildrenUpdates);
- }
- else
- {
- return new ObjectUpdate.AddObject(visit.getObject());
- }
+ //
+ for (ObjectUpdate.RemoveChild removeChildUpdate : removedChildrenUpdates)
+ {
+ removedChildren.add(removeChildUpdate.removedObjectUpdate.objectId);
}
+
+ //
+ return new ObjectUpdate.UpdateObject(object.getStructuralObject(), removedChildrenUpdates);
}
else if (visit instanceof ObjectVisit.Skip)
{
@@ -281,40 +262,28 @@
}
//
- return createRemove(object);
+ return createRemove((ObjectVisit.Evict)visit);
}
else
{
- throw new AssertionError();
+ throw new AssertionError("Cannot execute visit of " + visit);
}
}
- private ObjectUpdate.RemoveObject createRemove(UIObjectImpl object)
+ private ObjectUpdate.RemoveObject createRemove(ObjectVisit.Evict evict)
{
List<ObjectUpdate.RemoveObject> removedChildrenUpdates = new ArrayList<ObjectUpdate.RemoveObject>();
//
- InternalObjectContext objectContext = (InternalObjectContext)object.getContext();
-
- //
- if (objectContext.childRefs != null)
+ for (ObjectVisit.Evict evictedChild : evict.evictedChildren)
{
- for (UIObjectRef removedChildRef : objectContext.childRefs.values())
- {
- if (removedChildRef.loaded)
- {
- UIObjectImpl removedChild = (UIObjectImpl)context.getObject(removedChildRef.getId());
-
- //
- removedChildrenUpdates.add(createRemove(removedChild));
- }
- }
+ removedChildrenUpdates.add(createRemove(evictedChild));
}
//
- ObjectUpdate.AddChild addChildUpdate = deferredAddChildUpdates.remove(object.getId());
+ ObjectUpdate.AddChild addChildUpdate = deferredAddChildUpdates.remove(evict.getObjectId());
//
- return new ObjectUpdate.RemoveObject(object.getId(), removedChildrenUpdates, addChildUpdate);
+ return new ObjectUpdate.RemoveObject(evict.getObjectId(), removedChildrenUpdates, addChildUpdate);
}
}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-04 15:32:27 UTC (rev 11301)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-06 15:11:34 UTC (rev 11302)
@@ -26,6 +26,7 @@
import java.util.Set;
import java.util.Map;
+import java.util.Collection;
import java.io.Serializable;
/**
@@ -35,29 +36,44 @@
public abstract class ObjectVisit
{
- static ObjectVisit createEvict(UIObjectImpl object)
+ static ObjectVisit.Evict createEvict(UIObjectImpl object, Collection<Evict> evictedChildren)
{
- return new Evict(object);
+ return new Evict(object, evictedChildren);
}
- static ObjectVisit createLoad(UIObjectImpl object, ChildrenVisit children)
+ static RecursiveLoad createRecursiveLoad(UIObjectImpl object, ChildrenVisit children)
{
- return new Load(object, children);
+ return new RecursiveLoad(object, children);
}
+ static ObjectVisit createLoad(UIObjectImpl object)
+ {
+ return new Load(object);
+ }
+
static ObjectVisit createSkip(UIObjectImpl object)
{
return new Skip(object);
}
- static ObjectVisit createUpdate(
+ static SingleUpdate createSingleUpdate(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
+ Collection<Evict> evictedChildren)
+ {
+ return new SingleUpdate(object, removedProperties, updatedProperties, addedProperties, evictedChildren);
+ }
+
+ static RecursiveUpdate createRecursiveUpdate(
UIObjectImpl object,
Set<String> removedProperties,
Map<String, Serializable> updatedProperties,
Map<String, Serializable> addedProperties,
ChildrenVisit children)
{
- return new Update(object, removedProperties, updatedProperties, addedProperties, children);
+ return new RecursiveUpdate(object, removedProperties, updatedProperties, addedProperties, children);
}
/** . */
@@ -95,14 +111,29 @@
public static class Load extends ObjectVisit
{
+ private Load(UIObjectImpl object)
+ {
+ super(object);
+ }
+ }
+
+ public static class RecursiveLoad extends Load
+ {
+
/** . */
private final ChildrenVisit children;
- private Load(UIObjectImpl object, ChildrenVisit children)
+ private RecursiveLoad(UIObjectImpl object, ChildrenVisit children)
{
super(object);
//
+ if (children == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
this.children = children;
}
@@ -112,6 +143,70 @@
}
}
+ public static class RecursiveUpdate extends Update
+ {
+
+ /** . */
+ private final ChildrenVisit children;
+
+ private RecursiveUpdate(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
+ ChildrenVisit children)
+ {
+ super(
+ object,
+ removedProperties,
+ updatedProperties,
+ addedProperties);
+
+ //
+ if (children == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.children = children;
+ }
+
+ public ChildrenVisit getChildrenVisit()
+ {
+ return children;
+ }
+ }
+
+ public static class SingleUpdate extends Update
+ {
+
+ /** . */
+ private final Collection<Evict> evictedChildren;
+
+ public SingleUpdate(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
+ Collection<Evict> evictedChildren)
+ {
+ super(
+ object,
+ removedProperties,
+ updatedProperties,
+ addedProperties);
+
+ //
+ this.evictedChildren = evictedChildren;
+ }
+
+ public Collection<Evict> getEvictedChildren()
+ {
+ return evictedChildren;
+ }
+ }
+
public static class Update extends ObjectVisit
{
@@ -124,15 +219,11 @@
/** . */
private final Map<String, Serializable> addedProperties;
- /** . */
- private final ChildrenVisit children;
-
private Update(
UIObjectImpl object,
Set<String> removedProperties,
Map<String, Serializable> updatedProperties,
- Map<String, Serializable> addedProperties,
- ChildrenVisit children)
+ Map<String, Serializable> addedProperties)
{
super(object);
@@ -140,7 +231,6 @@
this.removedProperties = removedProperties;
this.updatedProperties = updatedProperties;
this.addedProperties = addedProperties;
- this.children = children;
}
public Set<String> getRemovedProperties()
@@ -157,18 +247,20 @@
{
return addedProperties;
}
-
- public ChildrenVisit getChildrenVisit()
- {
- return children;
- }
}
public static class Evict extends ObjectVisit
{
- private Evict(UIObjectImpl object)
+
+ /** . */
+ final Collection<Evict> evictedChildren;
+
+ public Evict(UIObjectImpl object, Collection<Evict> evictedChildren)
{
super(object);
+
+ //
+ this.evictedChildren = evictedChildren;
}
}
}
16 years
JBoss Portal SVN: r11301 - tags/JBoss_Portal_2_7_0_ALPHA1/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-04 11:32:27 -0400 (Fri, 04 Jul 2008)
New Revision: 11301
Modified:
tags/JBoss_Portal_2_7_0_ALPHA1/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
Log:
Oups
Modified: tags/JBoss_Portal_2_7_0_ALPHA1/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
===================================================================
--- tags/JBoss_Portal_2_7_0_ALPHA1/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-07-04 15:29:05 UTC (rev 11300)
+++ tags/JBoss_Portal_2_7_0_ALPHA1/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-07-04 15:32:27 UTC (rev 11301)
@@ -495,6 +495,18 @@
return Collections.unmodifiableSet(mimeTypeInfo.modes);
}
+
+ public ModeInfo getMode(Mode mode)
+ {
+ for (ModeInfo info: modes)
+ {
+ if (info.getMode().equals(mode))
+ {
+ return info;
+ }
+ }
+ return null;
+ }
public Set<WindowStateInfo> getAllWindowStates()
{
@@ -512,6 +524,18 @@
return Collections.unmodifiableSet(mimeTypeInfo.windowStates);
}
+ public WindowStateInfo getWindowState(WindowState windowState)
+ {
+ for (WindowStateInfo info: windowStates)
+ {
+ if (info.getWindowState().equals(windowState))
+ {
+ return info;
+ }
+ }
+ return null;
+ }
+
public Set<Locale> getAllLocales()
{
return locales;
16 years
JBoss Portal SVN: r11300 - modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-04 11:29:05 -0400 (Fri, 04 Jul 2008)
New Revision: 11300
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
Log:
make the properties change more detailed
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-04 15:23:32 UTC (rev 11299)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-07-04 15:29:05 UTC (rev 11300)
@@ -145,7 +145,12 @@
}
//
- return ObjectVisit.createUpdate(object, childrenVisit);
+ return ObjectVisit.createUpdate(
+ object,
+ refresh.getRemovedProperties(),
+ refresh.getUpdatedProperties(),
+ refresh.getAddedProperties(),
+ childrenVisit);
}
}
finally
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-04 15:23:32 UTC (rev 11299)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-04 15:29:05 UTC (rev 11300)
@@ -24,6 +24,10 @@
import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
+import java.util.Set;
+import java.util.Map;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -48,9 +52,12 @@
static ObjectVisit createUpdate(
UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
ChildrenVisit children)
{
- return new Update(object, children);
+ return new Update(object, removedProperties, updatedProperties, addedProperties, children);
}
/** . */
@@ -109,16 +116,48 @@
{
/** . */
+ private final Set<String> removedProperties;
+
+ /** . */
+ private final Map<String, Serializable> updatedProperties;
+
+ /** . */
+ private final Map<String, Serializable> addedProperties;
+
+ /** . */
private final ChildrenVisit children;
- private Update(UIObjectImpl object, ChildrenVisit children)
+ private Update(
+ UIObjectImpl object,
+ Set<String> removedProperties,
+ Map<String, Serializable> updatedProperties,
+ Map<String, Serializable> addedProperties,
+ ChildrenVisit children)
{
super(object);
//
+ this.removedProperties = removedProperties;
+ this.updatedProperties = updatedProperties;
+ this.addedProperties = addedProperties;
this.children = children;
}
+ public Set<String> getRemovedProperties()
+ {
+ return removedProperties;
+ }
+
+ public Map<String, Serializable> getUpdatedProperties()
+ {
+ return updatedProperties;
+ }
+
+ public Map<String, Serializable> getAddedProperties()
+ {
+ return addedProperties;
+ }
+
public ChildrenVisit getChildrenVisit()
{
return children;
16 years