JBoss Portal SVN: r7572 - in trunk/core: src/main/org/jboss/portal/core/impl/model/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-26 21:10:07 -0400 (Tue, 26 Jun 2007)
New Revision: 7572
Modified:
trunk/core/build.xml
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
Log:
port bug fixes from GA branch
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-06-27 00:58:53 UTC (rev 7571)
+++ trunk/core/build.xml 2007-06-27 01:10:07 UTC (rev 7572)
@@ -334,7 +334,6 @@
<fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
<fileset dir="${jboss.portal-identity.root}/lib" includes="portal-identity-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
- <fileset dir="${jboss.portal-samples.root}/lib" includes="portal-samples-lib.jar"/>
<fileset dir="${ehcache.ehcache.lib}" includes="ehcache.jar"/>
<fileset dir="${apache.collections.lib}" includes="commons-collections.jar"/>
<fileset dir="${javassist.javassist.lib}" includes="javassist.jar"/>
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-06-27 00:58:53 UTC (rev 7571)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-06-27 01:10:07 UTC (rev 7572)
@@ -69,6 +69,7 @@
private Map childrenMap;
private Map properties;
private Map unmodifiableProperties;
+ private boolean childrenAccessed;
public PortalObjectImpl()
{
@@ -79,6 +80,12 @@
{
this.declaredPropertyMap = new HashMap();
this.listener = null;
+
+ //
+ this.childrenMap = null;
+ this.properties = null;
+ this.unmodifiableProperties = null;
+ this.childrenAccessed = false;
}
public Long getKey()
@@ -236,11 +243,19 @@
{
/** . */
- private final Iterator iterator = objectNode.getChildren().values().iterator();
+ private final Iterator iterator;
/** . */
private PortalObject next = null;
+
+ public ChildrenIterator()
+ {
+ Map childrenMap = objectNode.getChildren();
+ Collection children = childrenMap.values();
+ iterator = children.iterator();
+ }
+
public void remove()
{
throw new UnsupportedOperationException();
@@ -293,6 +308,7 @@
if (childrenMap == null)
{
childrenMap = new HashMap();
+ childrenAccessed = true;
}
else
{
@@ -339,7 +355,8 @@
ObjectNode childNode = (ObjectNode)objectNode.getChildren().get(name);
if (childNode != null)
{
- return childNode.getObject();
+ childrenAccessed = true;
+ return childNode.getObject();
}
else
{
@@ -347,6 +364,9 @@
}
}
+ /**
+ * Get the aggregated properties in a lazy manner.
+ */
public Map getProperties()
{
// Lazy compute properties
@@ -368,6 +388,8 @@
//
this.unmodifiableProperties = Collections.unmodifiableMap(properties);
}
+
+ //
return unmodifiableProperties;
}
@@ -404,21 +426,53 @@
if (value == null)
{
declaredPropertyMap.remove(name);
-
- // If aggregated properties is loaded then we udpate it
- if (properties != null)
- {
- properties.remove(name);
- }
+ String parentValue = getParent().getProperty(name);
+ propagatePropertyUpdate(name, parentValue, true);
}
else
{
declaredPropertyMap.put(name, value);
+ propagatePropertyUpdate(name, value, true);
+ }
+ }
- // If aggregated properties is loaded then we udpate it
- if (properties != null)
+ /**
+ * This method propagates a property value update to descendants which have been *loaded* from the database.
+ * It considers that if the <code>properties</code> field of the runtime state is null then it means that
+ * the object is loaded but children have not made an attempt to read the properties of this object. Indeed
+ * if a child is loaded any attempt to access its aggregated properties will trigger the computation of
+ * the aggregated properties of this object.
+ *
+ * Null property values are considered as removal
+ *
+ * @param name the property name
+ * @param value the new property value
+ * @param force the update
+ */
+ private void propagatePropertyUpdate(String name, String value, boolean force)
+ {
+ if (properties != null)
+ {
+ if (force || !declaredPropertyMap.containsKey(name))
{
- properties.put(name, value);
+ if (value == null)
+ {
+ properties.remove(name);
+ }
+ else
+ {
+ properties.put(name, value);
+ }
+
+ //
+ if (childrenAccessed)
+ {
+ for (Iterator i = this.getChildren().iterator(); i.hasNext();)
+ {
+ PortalObjectImpl child = (PortalObjectImpl)i.next();
+ child.propagatePropertyUpdate(name, value, false);
+ }
+ }
}
}
}
@@ -437,11 +491,6 @@
return (String)properties.get(name);
}
-// public final boolean isDashboard()
-// {
-// return getDashboardContext() != null;
-// }
-
public abstract int getType();
public String toString()
@@ -543,6 +592,7 @@
protected final void addChild(String name, PortalObjectImpl childObject) throws DuplicatePortalObjectException, IllegalArgumentException
{
objectNode.addChild(name, childObject);
+ childrenAccessed = true;
}
private PortalObjectImpl copy(PortalObjectImpl parent, String name, boolean deep) throws DuplicatePortalObjectException
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java 2007-06-27 00:58:53 UTC (rev 7571)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java 2007-06-27 01:10:07 UTC (rev 7572)
@@ -85,7 +85,7 @@
this.uri = contentURI;
//
- setDeclaredProperty(PORTAL_PROP_WINDOW_CONTENT_TYPE, contentType.toString());
+ setDeclaredProperty(WindowImpl.PORTAL_PROP_WINDOW_CONTENT_TYPE, contentType.toString());
}
private ContentStateImpl getContentState()
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-06-27 00:58:53 UTC (rev 7571)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-06-27 01:10:07 UTC (rev 7572)
@@ -39,10 +39,7 @@
import org.jboss.portal.test.core.model.content.SimpleContent;
import org.jboss.portal.test.framework.AbstractPortalTestCase;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
/**
* Portal Object Container Test Cases based on the microcontainer architecture
@@ -68,6 +65,96 @@
TransactionAssert.commitTransaction();
}
+ /**
+ *
+ */
+ public void testPropertyUpdateCascadeToDescendantsWhenTheyDoNotDeclareIt() throws Exception
+ {
+ TransactionAssert.beginTransaction();
+ PortalContainer ctx = container.getContext();
+ Portal n1 = ctx.createPortal("default");
+ Page n2 = n1.createPage("default");
+ Page n3 = n2.createPage("default");
+ Map p1 = n1.getProperties();
+ Map p2 = n2.getProperties();
+ Map p3 = n3.getProperties();
+
+ //
+ n1.setDeclaredProperty("foo", "bar1");
+ assertEquals("bar1", p1.get("foo"));
+ assertEquals("bar1", p2.get("foo"));
+ assertEquals("bar1", p3.get("foo"));
+
+ //
+ n2.setDeclaredProperty("foo", "bar2");
+ assertEquals("bar1", p1.get("foo"));
+ assertEquals("bar2", p2.get("foo"));
+ assertEquals("bar2", p3.get("foo"));
+
+ TransactionAssert.commitTransaction();
+ }
+
+ /**
+ *
+ */
+ public void testPropertyUpdateDoesNotCascadeToDescendantsWhenTheyDeclareIt() throws Exception
+ {
+ TransactionAssert.beginTransaction();
+ PortalContainer ctx = container.getContext();
+ Portal n1 = ctx.createPortal("default");
+ Page n2 = n1.createPage("default");
+ Page n3 = n2.createPage("default");
+ Map p1 = n1.getProperties();
+ Map p2 = n2.getProperties();
+ Map p3 = n3.getProperties();
+
+ //
+ n2.setDeclaredProperty("foo", "bar1");
+ assertEquals(null, p1.get("foo"));
+ assertEquals("bar1", p2.get("foo"));
+ assertEquals("bar1", p3.get("foo"));
+
+ //
+ n1.setDeclaredProperty("foo", "bar2");
+ assertEquals("bar2", p1.get("foo"));
+ assertEquals("bar1", p2.get("foo"));
+ assertEquals("bar1", p3.get("foo"));
+
+ //
+ TransactionAssert.commitTransaction();
+ }
+
+ /**
+ *
+ */
+ public void testOverridenPropertyRemovalPropagateParentValueToDescendants() throws Exception
+ {
+ TransactionAssert.beginTransaction();
+ PortalContainer ctx = container.getContext();
+ Portal n1 = ctx.createPortal("default");
+ Page n2 = n1.createPage("default");
+ Page n3 = n2.createPage("default");
+ Map p1 = n1.getProperties();
+ Map p2 = n2.getProperties();
+ Map p3 = n3.getProperties();
+
+ //
+ n1.setDeclaredProperty("foo", "bar1");
+ n2.setDeclaredProperty("foo", "bar2");
+ assertEquals("bar1", p1.get("foo"));
+ assertEquals("bar2", p2.get("foo"));
+ assertEquals("bar2", p3.get("foo"));
+
+ //
+ n2.setDeclaredProperty("foo", null);
+ assertEquals("bar1", p1.get("foo"));
+ assertEquals("bar1", p2.get("foo"));
+ assertEquals("bar1", p3.get("foo"));
+
+ //
+ TransactionAssert.commitTransaction();
+ }
+
public void testCRUD() throws Exception
{
TransactionAssert.beginTransaction();
18 years, 10 months
JBoss Portal SVN: r7571 - in tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal: test/core/model/portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-26 20:58:53 -0400 (Tue, 26 Jun 2007)
New Revision: 7571
Modified:
tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
Log:
improve implementation of aggregated properties state management
Modified: tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-06-26 23:21:11 UTC (rev 7570)
+++ tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-06-27 00:58:53 UTC (rev 7571)
@@ -69,6 +69,7 @@
private Map childrenMap;
private Map properties;
private Map unmodifiableProperties;
+ private boolean childrenAccessed;
public PortalObjectImpl()
{
@@ -79,6 +80,12 @@
{
this.declaredPropertyMap = new HashMap();
this.listener = null;
+
+ //
+ this.childrenMap = null;
+ this.properties = null;
+ this.unmodifiableProperties = null;
+ this.childrenAccessed = false;
}
public Long getKey()
@@ -301,6 +308,7 @@
if (childrenMap == null)
{
childrenMap = new HashMap();
+ childrenAccessed = true;
}
else
{
@@ -347,7 +355,8 @@
ObjectNode childNode = (ObjectNode)objectNode.getChildren().get(name);
if (childNode != null)
{
- return childNode.getObject();
+ childrenAccessed = true;
+ return childNode.getObject();
}
else
{
@@ -355,6 +364,9 @@
}
}
+ /**
+ * Get the aggregated properties in a lazy manner.
+ */
public Map getProperties()
{
// Lazy compute properties
@@ -376,6 +388,8 @@
//
this.unmodifiableProperties = Collections.unmodifiableMap(properties);
}
+
+ //
return unmodifiableProperties;
}
@@ -412,51 +426,55 @@
if (value == null)
{
declaredPropertyMap.remove(name);
-
- removeProperty(name);
+ String parentValue = getParent().getProperty(name);
+ propagatePropertyUpdate(name, parentValue, true);
}
else
{
declaredPropertyMap.put(name, value);
-
- setProperty(name, value);
+ propagatePropertyUpdate(name, value, true);
}
}
- private void removeProperty(String name)
+ /**
+ * This method propagates a property value update to descendants which have been *loaded* from the database.
+ * It considers that if the <code>properties</code> field of the runtime state is null then it means that
+ * the object is loaded but children have not made an attempt to read the properties of this object. Indeed
+ * if a child is loaded any attempt to access its aggregated properties will trigger the computation of
+ * the aggregated properties of this object.
+ *
+ * Null property values are considered as removal
+ *
+ * @param name the property name
+ * @param value the new property value
+ * @param force the update
+ */
+ private void propagatePropertyUpdate(String name, String value, boolean force)
{
- if (properties != null)
- {
- properties.remove(name);
- }
-
- Iterator it = this.getChildren().iterator();
- while (it.hasNext())
- {
- PortalObject object = (PortalObject) it.next();
- if (object instanceof PortalObjectImpl)
- {
- ((PortalObjectImpl)object).removeProperty(name);
- }
- }
- }
+ if (properties != null)
+ {
+ if (force || !declaredPropertyMap.containsKey(name))
+ {
+ if (value == null)
+ {
+ properties.remove(name);
+ }
+ else
+ {
+ properties.put(name, value);
+ }
- private void setProperty(String name, String value)
- {
- if (properties != null)
- {
- properties.put(name, value);
- }
-
- Iterator it = this.getChildren().iterator();
- while (it.hasNext())
- {
- PortalObject object = (PortalObject) it.next();
- if (object instanceof PortalObjectImpl)
- {
- ((PortalObjectImpl)object).setProperty(name, value);
- }
- }
+ //
+ if (childrenAccessed)
+ {
+ for (Iterator i = this.getChildren().iterator();i.hasNext();)
+ {
+ PortalObjectImpl child = (PortalObjectImpl)i.next();
+ child.propagatePropertyUpdate(name, value, false);
+ }
+ }
+ }
+ }
}
public String getProperty(String name)
@@ -473,11 +491,6 @@
return (String)properties.get(name);
}
-// public final boolean isDashboard()
-// {
-// return getDashboardContext() != null;
-// }
-
public abstract int getType();
public String toString()
@@ -579,6 +592,7 @@
protected final void addChild(String name, PortalObjectImpl childObject) throws DuplicatePortalObjectException, IllegalArgumentException
{
objectNode.addChild(name, childObject);
+ childrenAccessed = true;
}
private PortalObjectImpl copy(PortalObjectImpl parent, String name, boolean deep) throws DuplicatePortalObjectException
Modified: tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
--- tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-06-26 23:21:11 UTC (rev 7570)
+++ tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-06-27 00:58:53 UTC (rev 7571)
@@ -39,10 +39,7 @@
import org.jboss.portal.test.core.model.content.SimpleContent;
import org.jboss.portal.test.framework.AbstractPortalTestCase;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
/**
* Portal Object Container Test Cases based on the microcontainer architecture
@@ -68,6 +65,96 @@
TransactionAssert.commitTransaction();
}
+ /**
+ *
+ */
+ public void testPropertyUpdateCascadeToDescendantsWhenTheyDoNotDeclareIt() throws Exception
+ {
+ TransactionAssert.beginTransaction();
+ PortalContainer ctx = container.getContext();
+ Portal n1 = ctx.createPortal("default");
+ Page n2 = n1.createPage("default");
+ Page n3 = n2.createPage("default");
+ Map p1 = n1.getProperties();
+ Map p2 = n2.getProperties();
+ Map p3 = n3.getProperties();
+
+ //
+ n1.setDeclaredProperty("foo", "bar1");
+ assertEquals("bar1", p1.get("foo"));
+ assertEquals("bar1", p2.get("foo"));
+ assertEquals("bar1", p3.get("foo"));
+
+ //
+ n2.setDeclaredProperty("foo", "bar2");
+ assertEquals("bar1", p1.get("foo"));
+ assertEquals("bar2", p2.get("foo"));
+ assertEquals("bar2", p3.get("foo"));
+
+ TransactionAssert.commitTransaction();
+ }
+
+ /**
+ *
+ */
+ public void testPropertyUpdateDoesNotCascadeToDescendantsWhenTheyDeclareIt() throws Exception
+ {
+ TransactionAssert.beginTransaction();
+ PortalContainer ctx = container.getContext();
+ Portal n1 = ctx.createPortal("default");
+ Page n2 = n1.createPage("default");
+ Page n3 = n2.createPage("default");
+ Map p1 = n1.getProperties();
+ Map p2 = n2.getProperties();
+ Map p3 = n3.getProperties();
+
+ //
+ n2.setDeclaredProperty("foo", "bar1");
+ assertEquals(null, p1.get("foo"));
+ assertEquals("bar1", p2.get("foo"));
+ assertEquals("bar1", p3.get("foo"));
+
+ //
+ n1.setDeclaredProperty("foo", "bar2");
+ assertEquals("bar2", p1.get("foo"));
+ assertEquals("bar1", p2.get("foo"));
+ assertEquals("bar1", p3.get("foo"));
+
+ //
+ TransactionAssert.commitTransaction();
+ }
+
+ /**
+ *
+ */
+ public void testOverridenPropertyRemovalPropagateParentValueToDescendants() throws Exception
+ {
+ TransactionAssert.beginTransaction();
+ PortalContainer ctx = container.getContext();
+ Portal n1 = ctx.createPortal("default");
+ Page n2 = n1.createPage("default");
+ Page n3 = n2.createPage("default");
+ Map p1 = n1.getProperties();
+ Map p2 = n2.getProperties();
+ Map p3 = n3.getProperties();
+
+ //
+ n1.setDeclaredProperty("foo", "bar1");
+ n2.setDeclaredProperty("foo", "bar2");
+ assertEquals("bar1", p1.get("foo"));
+ assertEquals("bar2", p2.get("foo"));
+ assertEquals("bar2", p3.get("foo"));
+
+ //
+ n2.setDeclaredProperty("foo", null);
+ assertEquals("bar1", p1.get("foo"));
+ assertEquals("bar1", p2.get("foo"));
+ assertEquals("bar1", p3.get("foo"));
+
+ //
+ TransactionAssert.commitTransaction();
+ }
+
public void testCRUD() throws Exception
{
TransactionAssert.beginTransaction();
18 years, 10 months
JBoss Portal SVN: r7570 - in trunk/core-samples: src/resources/portal-basic-samples-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-06-26 19:21:11 -0400 (Tue, 26 Jun 2007)
New Revision: 7570
Modified:
trunk/core-samples/build.xml
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
Log:
- Fixed deploy and undeploy tasks.
- Fixed incorrect portlet class reference.
Modified: trunk/core-samples/build.xml
===================================================================
--- trunk/core-samples/build.xml 2007-06-26 23:19:16 UTC (rev 7569)
+++ trunk/core-samples/build.xml 2007-06-26 23:21:11 UTC (rev 7570)
@@ -160,7 +160,7 @@
classname="org.jboss.portal.common.ant.Explode"
classpathref="explode.task.classpath"/>
</target>
-
+
<!--+====================================================================+-->
<!--| Compile |-->
<!--| |-->
@@ -238,7 +238,7 @@
</target>
<!-- Build the portal-basic-samples.sar -->
- <target name="output" depends="artifacts">
+ <target name="output" depends="artifacts">
<implode
dir="${build.resources}/portal-basic-samples.sar"
tofile="${build.lib}/portal-basic-samples.sar"/>
@@ -297,17 +297,27 @@
description="Deploy."
depends="output">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy file="${build.lib}/portal-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="${build.lib}/portal-basic-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}"
+ overwrite="true"/>
+ <copy file="${build.lib}/portal-jsp-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}"
+ overwrite="true"/>
+ <copy file="${build.lib}/portal-news-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}"
+ overwrite="true"/>
+ <copy file="${build.lib}/portal-weather-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}"
+ overwrite="true"/>
</target>
-
+
<!--
- | Undeploy the application
- -->
+ | Undeploy the application
+ -->
<target name="undeploy"
description="Undeploy."
depends="init">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-samples.sar"/>
+ <delete file="${build.lib}/portal-basic-samples.sar"/>
+ <delete file="${build.lib}/portal-jsp-samples.war"/>
+ <delete file="${build.lib}/portal-news-samples.war"/>
+ <delete file="${build.lib}/portal-weather-samples.war"/>
</target>
<target name="tests" depends="init, _buildmagic:configure:deployment">
Modified: trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-06-26 23:19:16 UTC (rev 7569)
+++ trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-06-26 23:21:11 UTC (rev 7570)
@@ -31,7 +31,7 @@
<description>Event Portlet</description>
<portlet-name>EventPortlet</portlet-name>
<display-name>Event Portlet</display-name>
- <portlet-class>org.jboss.samples.portlet.event.EventPortlet</portlet-class>
+ <portlet-class>org.jboss.portal.core.samples.basic.event.EventPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
18 years, 10 months
JBoss Portal SVN: r7569 - in tags/JBoss_Portal_2_6_0/core-samples: src/resources/portal-basic-samples-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-06-26 19:19:16 -0400 (Tue, 26 Jun 2007)
New Revision: 7569
Modified:
tags/JBoss_Portal_2_6_0/core-samples/build.xml
tags/JBoss_Portal_2_6_0/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
Log:
- Fixed deploy and undeploy tasks.
- Fixed incorrect portlet class reference.
Modified: tags/JBoss_Portal_2_6_0/core-samples/build.xml
===================================================================
--- tags/JBoss_Portal_2_6_0/core-samples/build.xml 2007-06-26 21:31:19 UTC (rev 7568)
+++ tags/JBoss_Portal_2_6_0/core-samples/build.xml 2007-06-26 23:19:16 UTC (rev 7569)
@@ -297,7 +297,10 @@
description="Deploy."
depends="output">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy file="${build.lib}/portal-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="${build.lib}/portal-basic-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="${build.lib}/portal-jsp-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="${build.lib}/portal-news-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="${build.lib}/portal-weather-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
</target>
<!--
@@ -307,7 +310,10 @@
description="Undeploy."
depends="init">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-samples.sar"/>
+ <delete file="${build.lib}/portal-basic-samples.sar"/>
+ <delete file="${build.lib}/portal-jsp-samples.war"/>
+ <delete file="${build.lib}/portal-news-samples.war"/>
+ <delete file="${build.lib}/portal-weather-samples.war"/>
</target>
<target name="tests" depends="init, _buildmagic:configure:deployment">
Modified: tags/JBoss_Portal_2_6_0/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
===================================================================
--- tags/JBoss_Portal_2_6_0/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-06-26 21:31:19 UTC (rev 7568)
+++ tags/JBoss_Portal_2_6_0/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-06-26 23:19:16 UTC (rev 7569)
@@ -31,7 +31,7 @@
<description>Event Portlet</description>
<portlet-name>EventPortlet</portlet-name>
<display-name>Event Portlet</display-name>
- <portlet-class>org.jboss.samples.portlet.event.EventPortlet</portlet-class>
+ <portlet-class>org.jboss.portal.core.samples.basic.event.EventPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
18 years, 10 months
JBoss Portal SVN: r7568 - trunk/core/src/main/org/jboss/portal/core/impl/model/portal.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-26 17:31:19 -0400 (Tue, 26 Jun 2007)
New Revision: 7568
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
Log:
revert JBPORTAL-1504 in order to fix it properly later
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-06-26 21:24:19 UTC (rev 7567)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-06-26 21:31:19 UTC (rev 7568)
@@ -405,52 +405,24 @@
{
declaredPropertyMap.remove(name);
- removeProperty(name);
+ // If aggregated properties is loaded then we udpate it
+ if (properties != null)
+ {
+ properties.remove(name);
+ }
}
else
{
declaredPropertyMap.put(name, value);
- setProperty(name, value);
- }
- }
-
- private void removeProperty(String name)
- {
- if (properties != null)
- {
- properties.remove(name);
- }
-
- Iterator it = this.getChildren().iterator();
- while (it.hasNext())
- {
- PortalObject object = (PortalObject) it.next();
- if (object instanceof PortalObjectImpl)
+ // If aggregated properties is loaded then we udpate it
+ if (properties != null)
{
- ((PortalObjectImpl)object).removeProperty(name);
+ properties.put(name, value);
}
}
}
- private void setProperty(String name, String value)
- {
- if (properties != null)
- {
- properties.put(name, value);
- }
-
- Iterator it = this.getChildren().iterator();
- while (it.hasNext())
- {
- PortalObject object = (PortalObject) it.next();
- if (object instanceof PortalObjectImpl)
- {
- ((PortalObjectImpl)object).setProperty(name, value);
- }
- }
- }
-
public String getProperty(String name)
{
if (name == null)
18 years, 10 months
JBoss Portal SVN: r7567 - in tags/JBoss_Portal_2_6_0/core: src/main/org/jboss/portal/core/impl/model/portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-26 17:24:19 -0400 (Tue, 26 Jun 2007)
New Revision: 7567
Modified:
tags/JBoss_Portal_2_6_0/core/build.xml
tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PageImpl.java
tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java
Log:
bug fix for bug introduced by the fix of JBPORTAL-1504, a test case was broken
Modified: tags/JBoss_Portal_2_6_0/core/build.xml
===================================================================
--- tags/JBoss_Portal_2_6_0/core/build.xml 2007-06-26 19:45:26 UTC (rev 7566)
+++ tags/JBoss_Portal_2_6_0/core/build.xml 2007-06-26 21:24:19 UTC (rev 7567)
@@ -334,7 +334,6 @@
<fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
<fileset dir="${jboss.portal-identity.root}/lib" includes="portal-identity-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
- <fileset dir="${jboss.portal-samples.root}/lib" includes="portal-samples-lib.jar"/>
<fileset dir="${ehcache.ehcache.lib}" includes="ehcache.jar"/>
<fileset dir="${apache.collections.lib}" includes="commons-collections.jar"/>
<fileset dir="${javassist.javassist.lib}" includes="javassist.jar"/>
Modified: tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PageImpl.java
===================================================================
--- tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PageImpl.java 2007-06-26 19:45:26 UTC (rev 7566)
+++ tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PageImpl.java 2007-06-26 21:24:19 UTC (rev 7567)
@@ -89,6 +89,7 @@
{
WindowImpl window = new WindowImpl(contentType, contentURI);
addChild(name, window);
+ window.setDeclaredProperty(WindowImpl.PORTAL_PROP_WINDOW_CONTENT_TYPE, contentType.toString());
return window;
}
Modified: tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-06-26 19:45:26 UTC (rev 7566)
+++ tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-06-26 21:24:19 UTC (rev 7567)
@@ -236,11 +236,19 @@
{
/** . */
- private final Iterator iterator = objectNode.getChildren().values().iterator();
+ private final Iterator iterator;
/** . */
private PortalObject next = null;
+
+ public ChildrenIterator()
+ {
+ Map childrenMap = objectNode.getChildren();
+ Collection children = childrenMap.values();
+ iterator = children.iterator();
+ }
+
public void remove()
{
throw new UnsupportedOperationException();
Modified: tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java
===================================================================
--- tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java 2007-06-26 19:45:26 UTC (rev 7566)
+++ tags/JBoss_Portal_2_6_0/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java 2007-06-26 21:24:19 UTC (rev 7567)
@@ -83,9 +83,6 @@
//
this.contentType = contentType;
this.uri = contentURI;
-
- //
- setDeclaredProperty(PORTAL_PROP_WINDOW_CONTENT_TYPE, contentType.toString());
}
private ContentStateImpl getContentState()
18 years, 10 months
JBoss Portal SVN: r7566 - docs/tags.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-26 15:45:26 -0400 (Tue, 26 Jun 2007)
New Revision: 7566
Added:
docs/tags/JBoss_Portal_2_6_0/
Log:
2.6 GA tag
Copied: docs/tags/JBoss_Portal_2_6_0 (from rev 7565, docs/trunk)
18 years, 10 months
JBoss Portal SVN: r7565 - tags.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-26 15:45:04 -0400 (Tue, 26 Jun 2007)
New Revision: 7565
Added:
tags/JBoss_Portal_2_6_0/
Log:
2.6 GA tag
Copied: tags/JBoss_Portal_2_6_0 (from rev 7564, trunk)
18 years, 10 months
JBoss Portal SVN: r7564 - in trunk/core/src: resources/portal-core-sar/META-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-26 15:43:40 -0400 (Tue, 26 Jun 2007)
New Revision: 7564
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
improve display of tab when an error occurs
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-06-26 19:15:17 UTC (rev 7563)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-06-26 19:43:40 UTC (rev 7564)
@@ -50,12 +50,15 @@
import org.jboss.portal.core.model.portal.command.view.ViewContextCommand;
import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.core.model.portal.command.view.ViewPortalCommand;
+import org.jboss.portal.core.model.portal.command.PageCommand;
import org.jboss.portal.core.theme.PageRendition;
import org.jboss.portal.core.aspects.controller.node.Navigation;
+import org.jboss.portal.core.impl.api.node.PortalNodeImpl;
import org.jboss.portal.identity.User;
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.security.PortalSecurityException;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.server.config.ServerConfig;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
@@ -120,9 +123,9 @@
PageRendition rendition = (PageRendition)resp;
//
- if (cmd instanceof RenderPageCommand)
+ if (cmd instanceof PageCommand)
{
- RenderPageCommand rpc = (RenderPageCommand)cmd;
+ PageCommand rpc = (PageCommand)cmd;
//
String tabbedNav = injectTabbedNav(rpc);
@@ -294,7 +297,7 @@
return null;
}
- public String injectTabbedNav(RenderPageCommand rpc)
+ public String injectTabbedNav(PageCommand rpc)
{
ControllerContext controllerCtx = rpc.getControllerContext();
ControllerRequestDispatcher rd = controllerCtx.getRequestDispatcher(targetContextPath, tabsPath);
@@ -302,7 +305,12 @@
//
if (rd != null)
{
- rd.setAttribute("org.jboss.portal.api.PORTAL_NODE", Navigation.getCurrentNode());
+ Page page = rpc.getPage();
+ PortalAuthorizationManager pam = portalAuthorizationManagerFactory.getManager();
+ PortalNodeImpl node = new PortalNodeImpl(pam, page);
+
+ //
+ rd.setAttribute("org.jboss.portal.api.PORTAL_NODE", node);
rd.setAttribute("org.jboss.portal.api.PORTAL_RUNTIME_CONTEXT", Navigation.getPortalRuntimeContext());
//
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-06-26 19:15:17 UTC (rev 7563)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-06-26 19:43:40 UTC (rev 7564)
@@ -245,13 +245,13 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>portal:service=Interceptor,type=Command,name=Control</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=ResourceAcquisition</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=Ajax</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=NavigationalState</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PortalNode</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PolicyEnforcement</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PageCustomizer</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Command,name=Control</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=EventBroadcaster</depends-list-element>
</depends-list>
</mbean>
18 years, 10 months
JBoss Portal SVN: r7563 - trunk/core-admin/src/main/org/jboss/portal/core/admin/ui.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-26 15:15:17 -0400 (Tue, 26 Jun 2007)
New Revision: 7563
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
Log:
fix issue in the oprtal control properties configurator that was not showing the right select items
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-06-26 19:11:26 UTC (rev 7562)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-06-26 19:15:17 UTC (rev 7563)
@@ -57,7 +57,7 @@
{
portalSelectItems = new ArrayList();
portalSelectItems.add(new SelectItem(ControlConstants.IGNORE_CONTROL_VALUE, "display the default error message."));
- portalSelectItems.add(new SelectItem(ControlConstants.HIDE_CONTROL_VALUE, "remove the resource from page."));
+ portalSelectItems.add(new SelectItem(ControlConstants.JSP_CONTROL_VALUE, "redirect to the specified resource."));
}
return portalSelectItems;
}
18 years, 10 months