JBoss Portal SVN: r12630 - branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-26 08:24:14 -0500 (Mon, 26 Jan 2009)
New Revision: 12630
Modified:
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/web.xml
Log:
- Not sure why facelets.BUILD_BEFORE_RESTORE was set to true before but it was causing issues with PB beta6
Modified: branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/web.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/web.xml 2009-01-26 13:23:44 UTC (rev 12629)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/web.xml 2009-01-26 13:24:14 UTC (rev 12630)
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ Copyright 2009, 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. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
@@ -28,8 +28,8 @@
version="2.4">
<context-param>
- <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
- <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
</context-param>
<context-param>
@@ -42,12 +42,6 @@
<param-value>true</param-value>
</context-param>
- <!--When turned on, it changes ViewHandler.restoreView() to build the view before asking the StateManager for help.-->
- <context-param>
- <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
- <param-value>true</param-value>
- </context-param>
-
<!-- Facelet configuration -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
15 years, 5 months
JBoss Portal SVN: r12629 - branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-26 08:23:44 -0500 (Mon, 26 Jan 2009)
New Revision: 12629
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/web.xml
Log:
- Not sure why facelets.BUILD_BEFORE_RESTORE was set to true before but it was causing issues with PB beta6
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/web.xml 2009-01-26 10:50:21 UTC (rev 12628)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/web.xml 2009-01-26 13:23:44 UTC (rev 12629)
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ Copyright 2009, 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. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
@@ -28,8 +28,8 @@
version="2.4">
<context-param>
- <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
- <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
</context-param>
<context-param>
@@ -42,12 +42,6 @@
<param-value>true</param-value>
</context-param>
- <!--When turned on, it changes ViewHandler.restoreView() to build the view before asking the StateManager for help.-->
- <context-param>
- <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
- <param-value>true</param-value>
- </context-param>
-
<!-- Facelet configuration -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
15 years, 5 months
JBoss Portal SVN: r12628 - in branches/Enterprise_Portal_Platform_4_3/core: src/main/org/jboss/portal/core/impl/model/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-26 05:50:21 -0500 (Mon, 26 Jan 2009)
New Revision: 12628
Added:
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java
Modified:
branches/Enterprise_Portal_Platform_4_3/core/build.xml
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
Log:
- JBPORTAL-2281: Performance improvements (that correctly works now!)
Modified: branches/Enterprise_Portal_Platform_4_3/core/build.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core/build.xml 2009-01-26 10:40:43 UTC (rev 12627)
+++ branches/Enterprise_Portal_Platform_4_3/core/build.xml 2009-01-26 10:50:21 UTC (rev 12628)
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ Copyright 2009, 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. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
@@ -378,12 +378,13 @@
</filterset>
<fileset dir="${build.resources}/jboss-portal" includes="**/*.xml"/>
</copy>
-
- <!-- add jboss-cache-hibernate integration jar -->
- <copy todir="${build.resources}/jboss-portal-ha.sar/lib">
- <fileset dir="${org/jboss/cluster/hibernate.jbc.cacheprovider.root}/lib" includes="hibernate-jbc-cacheprovider.jar"/>
- </copy>
+ <!-- add jboss-cache-hibernate integration jar -->
+ <copy todir="${build.resources}/jboss-portal-ha.sar/lib">
+ <fileset dir="${org/jboss/cluster/hibernate.jbc.cacheprovider.root}/lib"
+ includes="hibernate-jbc-cacheprovider.jar"/>
+ </copy>
+
<implode
dir="${build.resources}/jboss-portal-ha.sar"
tofile="${build.lib}/jboss-portal-ha.sar"/>
@@ -552,8 +553,8 @@
<execute-tests>
<x-sysproperty>
- <!--<jvmarg value="-Xdebug"/>-->
- <!--<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>-->
+ <!--<jvmarg value="-Xdebug"/>-->
+ <!--<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>-->
<sysproperty
key="jboss.aop.path"
@@ -581,7 +582,13 @@
<parameter name="CacheNaturalId" value="true"/>
<parameter name="Config" value="persistent-jboss-beans.xml"/>
</zest>
- <zest todir="${test.reports}" name="org.jboss.portal.test.core.model.portal.coordination.CoordinationServiceTestCase"
+ <zest todir="${test.reports}" name="org.jboss.portal.test.core.model.portal.PortalObjectTestCase"
+ outfile="TEST-PortalObjectTestCase">
+ <parameter name="CacheNaturalId" value="true"/>
+ <parameter name="Config" value="persistent-jboss-beans.xml"/>
+ </zest>
+ <zest todir="${test.reports}"
+ name="org.jboss.portal.test.core.model.portal.coordination.CoordinationServiceTestCase"
outfile="TEST-CoordinationServiceTestCase">
<parameter name="CacheNaturalId" value="true"/>
<parameter name="Config" value="persistent-jboss-beans.xml"/>
@@ -695,10 +702,12 @@
-->
<target name="one-test" depends="init" if="test" description="Run a single unit test">
<property name="build.testlog" value="${module.output}/log"/>
+ <property name="test.reports" value="${module.output}/tests"/>
<mkdir dir="${build.reports}"/>
<mkdir dir="${build.testlog}"/>
-
+ <mkdir dir="${test.reports}"/>
+
<junit printsummary="yes" showoutput="yes" dir="${module.output}">
<!--jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006" /-->
Modified: branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2009-01-26 10:40:43 UTC (rev 12627)
+++ branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2009-01-26 10:50:21 UTC (rev 12628)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, 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. *
@@ -20,6 +20,7 @@
* 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.core.impl.model.portal;
import org.apache.log4j.Logger;
@@ -40,6 +41,7 @@
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
+import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
@@ -75,8 +77,6 @@
private ObjectNode objectNode;
// Runtime fields
-
- private Map childrenMap;
private Map properties;
private Map unmodifiableProperties;
private SortedSet accessedChildren;
@@ -92,7 +92,6 @@
this.listener = null;
//
- this.childrenMap = null;
this.properties = null;
this.unmodifiableProperties = null;
this.accessedChildren = null;
@@ -118,8 +117,6 @@
this.objectNode = objectNode;
}
- //
-
public PortalObjectId getId()
{
return objectNode.getPath();
@@ -141,13 +138,12 @@
{
return objectNode.getName();
}
-
+
public void setDisplayNames(Map displayNames)
{
this.displayNames = displayNames;
}
-
-
+
public Map getDisplayNames()
{
return displayNames;
@@ -161,7 +157,7 @@
}
displayNames = new HashMap();
-
+
Map map = displayName.getValues();
Iterator it = map.values().iterator();
while (it.hasNext())
@@ -170,7 +166,7 @@
displayNames.put(value.getLocale(), value.getString());
}
}
-
+
public LocalizedString getDisplayName()
{
if (displayNames != null)
@@ -203,13 +199,14 @@
private class ChildrenCollection implements Collection
{
-
/** . */
private final int mask;
+ private final SortedMap children;
- public ChildrenCollection(int mask)
+ public ChildrenCollection(int mask, Map children)
{
this.mask = mask;
+ this.children = new TreeMap(children);
}
public void clear()
@@ -254,30 +251,36 @@
public boolean isEmpty()
{
- return objectNode.getChildren().isEmpty();
+ return children.isEmpty();
}
public int size()
{
- if (mask == ALL_TYPES_MASK)
+ if (mask != ALL_TYPES_MASK)
{
- return objectNode.getChildren().size();
- }
- else
- {
int count = 0;
- for (Iterator i = iterator(); i.hasNext();)
+
+ for (Object object : children.values())
{
- i.next();
- count++;
+ ObjectNode childNode = (ObjectNode)object;
+ PortalObjectImpl childObject = childNode.getObject();
+ if (isMatchingMask(childObject, mask))
+ {
+ count++;
+ }
}
+
return count;
}
+ else
+ {
+ return children.size();
+ }
}
public Object[] toArray()
{
- return toArray(new Object[0]);
+ return toArray(new Object[children.size()]);
}
public Iterator iterator()
@@ -287,7 +290,7 @@
public Object[] toArray(Object a[])
{
- ArrayList tmp = new ArrayList(objectNode.getChildren().size());
+ ArrayList tmp = new ArrayList(children.size());
//
Set accessedChildren = getAccessedChildren();
@@ -308,19 +311,14 @@
private class ChildrenIterator implements Iterator
{
-
- /** . */
private final Iterator iterator;
- /** . */
private PortalObject nextChild = null;
public ChildrenIterator()
{
// Make sure the children are sorted for consistent ordering downstream
- Map childrenMap = new TreeMap(objectNode.getChildren());
- Collection children = childrenMap.values();
- iterator = children.iterator();
+ iterator = children.values().iterator();
}
public void remove()
@@ -336,7 +334,7 @@
{
ObjectNode childNode = (ObjectNode)iterator.next();
PortalObjectImpl childObject = childNode.getObject();
- if (mask == ALL_TYPES_MASK || (childObject.getMask() & mask) != 0)
+ if (isMatchingMask(childObject, mask))
{
nextChild = childObject;
}
@@ -369,32 +367,17 @@
}
}
+ private boolean isMatchingMask(PortalObjectImpl object, int mask)
+ {
+ return (mask == ALL_TYPES_MASK || (object.getMask() & mask) != 0);
+ }
+
public Collection getChildren(int wantedMask)
{
- /// Correct eventually the mask
+ // Correct eventually the mask
final int mask = wantedMask & ALL_TYPES_MASK;
- // Compute the lookup cache key
- Integer key = new Integer(mask);
-
- //
- Collection children = null;
- if (childrenMap == null)
- {
- childrenMap = new HashMap();
- }
- else
- {
- children = (Collection)childrenMap.get(key);
- }
-
- //
- if (children == null)
- {
- children = new ChildrenCollection(mask);
- childrenMap.put(key, children);
- }
- return children;
+ return new ChildrenCollection(mask, objectNode.getChildren());
}
public String getListener()
@@ -445,7 +428,7 @@
PortalObject child = getChild(name);
// only return the child if it matches the expected class
- if(expectedType.isInstance(child))
+ if (expectedType.isInstance(child))
{
return expectedType.cast(child);
}
@@ -512,7 +495,7 @@
public void setDeclaredProperty(String name, String value)
{
- ParameterValidation.throwIllegalArgExceptionIfNull(name, "property name");
+ ParameterValidation.throwIllegalArgExceptionIfNull(name, "property name");
if (value == null)
{
declaredPropertyMap.remove(name);
Added: branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java (rev 0)
+++ branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java 2009-01-26 10:50:21 UTC (rev 12628)
@@ -0,0 +1,202 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.test.core.model.portal;
+
+import junit.framework.TestSuite;
+import org.jboss.portal.common.junit.TransactionAssert;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.portal.Context;
+import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
+import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class PortalObjectTestCase extends AbstractPortalObjectContainerTestCase
+{
+ private Context root;
+ private Portal p_1;
+ private Page p_1_1;
+ private Page p_1_2;
+ private static final int A_INDEX = 65;
+
+ public static TestSuite suite() throws Exception
+ {
+ return AbstractPortalObjectContainerTestCase.suite(PortalObjectTestCase.class);
+ }
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ TransactionAssert.beginTransaction();
+ root = container.getContext("");
+ p_1 = root.createPortal("1");
+ p_1_1 = p_1.createPage("1");
+ p_1_2 = p_1.createPage("2");
+ p_1_1.createPage("11");
+ p_1_1.createPage("12");
+ p_1_1.createPage("13");
+ p_1_1.createPage("14");
+ p_1_1.createWindow("w1", ContentType.PORTLET, "foo1");
+ p_1_1.createWindow("w2", ContentType.PORTLET, "foo2");
+ p_1_1.createWindow("w3", ContentType.PORTLET, "foo3");
+ p_1_2.createPage("21");
+ p_1_2.createPage("22");
+ p_1_2.createPage("23");
+ p_1_2.createPage("24");
+ TransactionAssert.commitTransaction();
+ }
+
+ public void testGetChildren() throws Exception
+ {
+ Collection<PortalObject> children = root.getChildren();
+ assertEquals(1, children.size());
+
+ children = p_1.getChildren();
+ assertEquals(2, children.size());
+
+ children = p_1_1.getChildren();
+ assertEquals(7, children.size());
+
+ children = p_1_2.getChildren();
+ assertEquals(4, children.size());
+
+ children = p_1_1.getChildren(PortalObject.PAGE_MASK);
+ assertEquals(4, children.size());
+
+ children = p_1_1.getChildren(PortalObject.WINDOW_MASK);
+ assertEquals(3, children.size());
+ }
+
+ public void testGetChild()
+ {
+ PortalObject child = p_1_1.getChild("w1");
+ assertNotNull(child);
+ assertEquals("w1", child.getName());
+ assertEquals(p_1_1, child.getParent());
+ }
+
+ public void testIterator() throws NoSuchPortalObjectException, DuplicatePortalObjectException
+ {
+ Portal portal;
+ Page page;
+
+ TransactionAssert.beginTransaction();
+ root.destroyChild(p_1.getName());
+ char nbChildren = 20;
+ portal = root.createPortal("portal");
+ page = portal.createPage("page");
+
+ // create children, we need to convert the current index with Character.toString as default ordering results in
+ // pa10 < pa2 and in test failure
+ for (char i = A_INDEX; i < nbChildren + A_INDEX; i++)
+ {
+ // convert current index into a letter
+ String letter = Character.toString(i);
+ page.createPage("pa" + letter);
+ page.createWindow("w" + letter, ContentType.PORTLET, "foo" + letter);
+ }
+ TransactionAssert.commitTransaction();
+
+ Collection<PortalObject> children = page.getChildren(PortalObject.PAGE_MASK);
+ assertNotNull(children);
+ char i = A_INDEX;
+ String name;
+ for (PortalObject child : children)
+ {
+ name = child.getName();
+ assertEquals("pa" + Character.toString(i++), name);
+ }
+
+ children = page.getChildren(PortalObject.WINDOW_MASK);
+ assertNotNull(children);
+ i = A_INDEX;
+ for (PortalObject child : children)
+ {
+ name = child.getName();
+ assertEquals("w" + Character.toString(i++), name);
+ }
+ }
+
+ /*public void testPerformanceGetChildren() throws DuplicatePortalObjectException, NoSuchPortalObjectException
+ {
+ Portal portal;
+ Page page;
+
+ long time = System.currentTimeMillis();
+ TransactionAssert.beginTransaction();
+ root.destroyChild(p_1.getName());
+ int nbPortals = 5;
+ int nbPages = 20;
+ int nbWindows = 20;
+ for(int i = 0; i < nbPortals; i++)
+ {
+ portal = root.createPortal("p" + i);
+ for(int j = 0; j < nbPages; j++)
+ {
+ String name = "p" + i + "pa" + j;
+ page = portal.createPage(name);
+ page.createPage(name + "pa1");
+ page.createPage(name + "pa2");
+ for (int k = 0; k < nbWindows; k++)
+ {
+ page.createWindow(name + "w" + k, ContentType.PORTLET, "foo" + k);
+ }
+ }
+ }
+ TransactionAssert.commitTransaction();
+ System.out.println("Creation time = " + (System.currentTimeMillis() - time));
+
+
+ time = System.currentTimeMillis();
+ int portalIndex = (int) (nbPortals * Math.random());
+ assertEquals(nbPortals, root.getChildren().size());
+ assertEquals(nbPortals, root.getChildren(PortalObject.PORTAL_MASK).size());
+ assertEquals(nbPages, root.getChild("p" + portalIndex).getChildren().size());
+ assertEquals(nbPages, root.getChild("p" + portalIndex).getChildren(PortalObject.PAGE_MASK).size());
+
+ for (int i = 0; i < 1000000; i++)
+ {
+ portalIndex = (int) (nbPortals * Math.random());
+ String portalName = "p" + portalIndex;
+ PortalObject child = root.getChild(portalName);
+ assertNotNull(child);
+ int pageIndex = (int) (nbPages * Math.random());
+ child = child.getChild(portalName + "pa" + pageIndex);
+ assertNotNull(child);
+ assertEquals(2 + nbWindows, child.getChildren().size());
+ assertEquals(2, child.getChildren(PortalObject.PAGE_MASK).size());
+ assertEquals(nbWindows, child.getChildren(PortalObject.WINDOW_MASK).size());
+ }
+ System.out.println("Tests time = " + (System.currentTimeMillis() - time));
+ }*/
+}
15 years, 5 months
JBoss Portal SVN: r12627 - in branches/JBoss_Portal_Branch_2_6/core: src/main/org/jboss/portal/test/core/model/portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-26 05:40:43 -0500 (Mon, 26 Jan 2009)
New Revision: 12627
Added:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java
Modified:
branches/JBoss_Portal_Branch_2_6/core/build.xml
Log:
- Added test case.
Modified: branches/JBoss_Portal_Branch_2_6/core/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/build.xml 2009-01-26 10:35:23 UTC (rev 12626)
+++ branches/JBoss_Portal_Branch_2_6/core/build.xml 2009-01-26 10:40:43 UTC (rev 12627)
@@ -579,6 +579,11 @@
<parameter name="Config" value="transient-jboss-beans.xml"/>
</zest>
-->
+ <zest todir="${test.reports}" name="org.jboss.portal.test.core.model.portal.PortalObjectTestCase"
+ outfile="TEST-PortalObjectTestCase">
+ <parameter name="CacheNaturalId" value="true"/>
+ <parameter name="Config" value="persistent-jboss-beans.xml"/>
+ </zest>
<zest todir="${test.reports}" name="org.jboss.portal.test.core.model.portal.PortalObjectContainerTestCase"
outfile="TEST-PortalObjectContainerTestCase">
<parameter name="CacheNaturalId" value="true"/>
Added: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java 2009-01-26 10:40:43 UTC (rev 12627)
@@ -0,0 +1,202 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.test.core.model.portal;
+
+import junit.framework.TestSuite;
+import org.jboss.portal.common.junit.TransactionAssert;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.portal.Context;
+import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
+import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class PortalObjectTestCase extends AbstractPortalObjectContainerTestCase
+{
+ private Context root;
+ private Portal p_1;
+ private Page p_1_1;
+ private Page p_1_2;
+ private static final int A_INDEX = 65;
+
+ public static TestSuite suite() throws Exception
+ {
+ return AbstractPortalObjectContainerTestCase.suite(PortalObjectTestCase.class);
+ }
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ TransactionAssert.beginTransaction();
+ root = container.getContext("");
+ p_1 = root.createPortal("1");
+ p_1_1 = p_1.createPage("1");
+ p_1_2 = p_1.createPage("2");
+ p_1_1.createPage("11");
+ p_1_1.createPage("12");
+ p_1_1.createPage("13");
+ p_1_1.createPage("14");
+ p_1_1.createWindow("w1", ContentType.PORTLET, "foo1");
+ p_1_1.createWindow("w2", ContentType.PORTLET, "foo2");
+ p_1_1.createWindow("w3", ContentType.PORTLET, "foo3");
+ p_1_2.createPage("21");
+ p_1_2.createPage("22");
+ p_1_2.createPage("23");
+ p_1_2.createPage("24");
+ TransactionAssert.commitTransaction();
+ }
+
+ public void testGetChildren() throws Exception
+ {
+ Collection<PortalObject> children = root.getChildren();
+ assertEquals(1, children.size());
+
+ children = p_1.getChildren();
+ assertEquals(2, children.size());
+
+ children = p_1_1.getChildren();
+ assertEquals(7, children.size());
+
+ children = p_1_2.getChildren();
+ assertEquals(4, children.size());
+
+ children = p_1_1.getChildren(PortalObject.PAGE_MASK);
+ assertEquals(4, children.size());
+
+ children = p_1_1.getChildren(PortalObject.WINDOW_MASK);
+ assertEquals(3, children.size());
+ }
+
+ public void testGetChild()
+ {
+ PortalObject child = p_1_1.getChild("w1");
+ assertNotNull(child);
+ assertEquals("w1", child.getName());
+ assertEquals(p_1_1, child.getParent());
+ }
+
+ public void testIterator() throws NoSuchPortalObjectException, DuplicatePortalObjectException
+ {
+ Portal portal;
+ Page page;
+
+ TransactionAssert.beginTransaction();
+ root.destroyChild(p_1.getName());
+ char nbChildren = 20;
+ portal = root.createPortal("portal");
+ page = portal.createPage("page");
+
+ // create children, we need to convert the current index with Character.toString as default ordering results in
+ // pa10 < pa2 and in test failure
+ for (char i = A_INDEX; i < nbChildren + A_INDEX; i++)
+ {
+ // convert current index into a letter
+ String letter = Character.toString(i);
+ page.createPage("pa" + letter);
+ page.createWindow("w" + letter, ContentType.PORTLET, "foo" + letter);
+ }
+ TransactionAssert.commitTransaction();
+
+ Collection<PortalObject> children = page.getChildren(PortalObject.PAGE_MASK);
+ assertNotNull(children);
+ char i = A_INDEX;
+ String name;
+ for (PortalObject child : children)
+ {
+ name = child.getName();
+ assertEquals("pa" + Character.toString(i++), name);
+ }
+
+ children = page.getChildren(PortalObject.WINDOW_MASK);
+ assertNotNull(children);
+ i = A_INDEX;
+ for (PortalObject child : children)
+ {
+ name = child.getName();
+ assertEquals("w" + Character.toString(i++), name);
+ }
+ }
+
+ /*public void testPerformanceGetChildren() throws DuplicatePortalObjectException, NoSuchPortalObjectException
+ {
+ Portal portal;
+ Page page;
+
+ long time = System.currentTimeMillis();
+ TransactionAssert.beginTransaction();
+ root.destroyChild(p_1.getName());
+ int nbPortals = 5;
+ int nbPages = 20;
+ int nbWindows = 20;
+ for(int i = 0; i < nbPortals; i++)
+ {
+ portal = root.createPortal("p" + i);
+ for(int j = 0; j < nbPages; j++)
+ {
+ String name = "p" + i + "pa" + j;
+ page = portal.createPage(name);
+ page.createPage(name + "pa1");
+ page.createPage(name + "pa2");
+ for (int k = 0; k < nbWindows; k++)
+ {
+ page.createWindow(name + "w" + k, ContentType.PORTLET, "foo" + k);
+ }
+ }
+ }
+ TransactionAssert.commitTransaction();
+ System.out.println("Creation time = " + (System.currentTimeMillis() - time));
+
+
+ time = System.currentTimeMillis();
+ int portalIndex = (int) (nbPortals * Math.random());
+ assertEquals(nbPortals, root.getChildren().size());
+ assertEquals(nbPortals, root.getChildren(PortalObject.PORTAL_MASK).size());
+ assertEquals(nbPages, root.getChild("p" + portalIndex).getChildren().size());
+ assertEquals(nbPages, root.getChild("p" + portalIndex).getChildren(PortalObject.PAGE_MASK).size());
+
+ for (int i = 0; i < 1000000; i++)
+ {
+ portalIndex = (int) (nbPortals * Math.random());
+ String portalName = "p" + portalIndex;
+ PortalObject child = root.getChild(portalName);
+ assertNotNull(child);
+ int pageIndex = (int) (nbPages * Math.random());
+ child = child.getChild(portalName + "pa" + pageIndex);
+ assertNotNull(child);
+ assertEquals(2 + nbWindows, child.getChildren().size());
+ assertEquals(2, child.getChildren(PortalObject.PAGE_MASK).size());
+ assertEquals(nbWindows, child.getChildren(PortalObject.WINDOW_MASK).size());
+ }
+ System.out.println("Tests time = " + (System.currentTimeMillis() - time));
+ }*/
+}
15 years, 5 months
JBoss Portal SVN: r12626 - in branches/JBoss_Portal_Branch_2_7: core-admin and 3 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-26 05:35:23 -0500 (Mon, 26 Jan 2009)
New Revision: 12626
Modified:
branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
branches/JBoss_Portal_Branch_2_7/core-admin/build.xml
branches/JBoss_Portal_Branch_2_7/core-identity/build.xml
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
branches/JBoss_Portal_Branch_2_7/core-wsrp/build.xml
Log:
Using Portlet Bridge 1.0.0.B6, and removing Richfaces libs
Modified: branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2009-01-26 09:53:50 UTC (rev 12625)
+++ branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2009-01-26 10:35:23 UTC (rev 12626)
@@ -94,8 +94,7 @@
<componentref name="ehcache" version="1.2.2"/>
<componentref name="el" version="1.0"/>
<componentref name="facelets" version="1.1.15-B1"/>
- <componentref name="richfaces" version="3.3.0.GA"/>
- <componentref name="jboss/portlet-bridge" version="1.0.0.B5"/>
+ <componentref name="jboss/portlet-bridge" version="1.0.0.B6"/>
<componentref name="hibernate" version="3.2.4.SP1_CP06-brew"/>
<componentref name="httpunit" version="1.6"/>
<componentref name="hsqldb" version="1.8.0.8.patch01-brew"/>
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/build.xml 2009-01-26 09:53:50 UTC (rev 12625)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/build.xml 2009-01-26 10:35:23 UTC (rev 12626)
@@ -99,7 +99,6 @@
<path refid="apache.log4j.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="el.el.classpath"/>
- <path refid="richfaces.richfaces.classpath"/>
<path refid="facelets.facelets.classpath"/>
<path refid="portlet.portlet.classpath"/>
<path refid="jboss/portlet.bridge.classpath"/>
@@ -193,9 +192,6 @@
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-api.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-api.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-ui.jar"/>
<fileset dir="${build.lib}" includes="portal-core-admin-lib.jar"/>
<fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-lib.jar"/>
<fileset dir="${apache.beanutils.lib}" includes="commons-beanutils.jar"/>
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/build.xml 2009-01-26 09:53:50 UTC (rev 12625)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/build.xml 2009-01-26 10:35:23 UTC (rev 12626)
@@ -108,7 +108,6 @@
<path refid="jbpm.jpdl.classpath"/>
<path refid="glassfish.jsf.classpath"/>
<path refid="el.el.classpath"/>
- <path refid="richfaces.richfaces.classpath"/>
<path refid="facelets.facelets.classpath"/>
<path refid="portlet.portlet.classpath"/>
<path refid="jboss/portlet.bridge.classpath"/>
@@ -211,9 +210,6 @@
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-api.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-api.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-ui.jar"/>
<fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-lib.jar"/>
<fileset dir="${apache.beanutils.lib}" includes="commons-beanutils.jar"/>
<fileset dir="${apache.lang.lib}" includes="commons-lang.jar"/>
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2009-01-26 09:53:50 UTC (rev 12625)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2009-01-26 10:35:23 UTC (rev 12626)
@@ -87,19 +87,6 @@
<param-value>server</param-value>
</context-param>
- <filter>
- <display-name>Ajax4jsf Filter</display-name>
- <filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.Filter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>ajax4jsf</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- <dispatcher>FORWARD</dispatcher>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>INCLUDE</dispatcher>
- </filter-mapping>
-
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/build.xml 2009-01-26 09:53:50 UTC (rev 12625)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/build.xml 2009-01-26 10:35:23 UTC (rev 12626)
@@ -100,7 +100,6 @@
<path refid="junit.junit.classpath"/>
<path refid="glassfish.jsf.classpath"/>
<path refid="el.el.classpath"/>
- <path refid="richfaces.richfaces.classpath"/>
<path refid="facelets.facelets.classpath"/>
<path refid="portlet.portlet.classpath"/>
<path refid="jboss/portlet.bridge.classpath"/>
@@ -208,9 +207,6 @@
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-api.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-api.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-ui.jar"/>
<fileset dir="${build.lib}" includes="portal-wsrp-admin-lib.jar"/>
<fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-lib.jar"/>
<!--<fileset dir="${el.el.lib}" includes="el-api.jar,el-ri.jar"/>-->
15 years, 5 months
JBoss Portal SVN: r12625 - branches/JBoss_Portal_Branch_2_7/search/src/main/org/jboss/portal/search/federation/impl.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-26 04:53:50 -0500 (Mon, 26 Jan 2009)
New Revision: 12625
Modified:
branches/JBoss_Portal_Branch_2_7/search/src/main/org/jboss/portal/search/federation/impl/IndexFederationService.java
Log:
oups...
Was supposed to be multithreaded
Modified: branches/JBoss_Portal_Branch_2_7/search/src/main/org/jboss/portal/search/federation/impl/IndexFederationService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/search/src/main/org/jboss/portal/search/federation/impl/IndexFederationService.java 2009-01-26 08:31:22 UTC (rev 12624)
+++ branches/JBoss_Portal_Branch_2_7/search/src/main/org/jboss/portal/search/federation/impl/IndexFederationService.java 2009-01-26 09:53:50 UTC (rev 12625)
@@ -92,7 +92,7 @@
if (status != Info.Status.INDEXING)
{
Thread thread = new ReindexFederatedIndexThread(federated);
- thread.run();
+ thread.start();
}
}
}
15 years, 5 months
JBoss Portal SVN: r12624 - in branches/Enterprise_Portal_Platform_4_3: core-admin and 3 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-26 03:31:22 -0500 (Mon, 26 Jan 2009)
New Revision: 12624
Modified:
branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml
branches/Enterprise_Portal_Platform_4_3/core-admin/build.xml
branches/Enterprise_Portal_Platform_4_3/core-identity/build.xml
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
branches/Enterprise_Portal_Platform_4_3/core-wsrp/build.xml
Log:
Using Portlet Bridge 1.0.0.B6, and removing Richfaces libs
Modified: branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml 2009-01-24 12:07:08 UTC (rev 12623)
+++ branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml 2009-01-26 08:31:22 UTC (rev 12624)
@@ -71,8 +71,7 @@
<componentref name="ehcache" version="1.2.2"/>
<componentref name="el" version="1.0"/>
<componentref name="facelets" version="1.1.15-B1"/>
- <componentref name="richfaces" version="3.3.0.GA"/>
- <componentref name="jboss/portlet-bridge" version="1.0.0.B5"/>
+ <componentref name="jboss/portlet-bridge" version="1.0.0.B6"/>
<componentref name="hibernate" version="3.2.4.SP1_CP06-brew"/>
<componentref name="httpunit" version="1.6"/>
<componentref name="hsqldb" version="1.8.0.8.patch01-brew"/>
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/build.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/build.xml 2009-01-24 12:07:08 UTC (rev 12623)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/build.xml 2009-01-26 08:31:22 UTC (rev 12624)
@@ -99,7 +99,6 @@
<path refid="apache.log4j.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="el.el.classpath"/>
- <path refid="richfaces.richfaces.classpath"/>
<path refid="facelets.facelets.classpath"/>
<path refid="portlet.portlet.classpath"/>
<path refid="jboss/portlet.bridge.classpath"/>
@@ -193,9 +192,6 @@
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-api.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-api.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-ui.jar"/>
<fileset dir="${build.lib}" includes="portal-core-admin-lib.jar"/>
<fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-lib.jar"/>
<fileset dir="${apache.beanutils.lib}" includes="commons-beanutils.jar"/>
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/build.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/build.xml 2009-01-24 12:07:08 UTC (rev 12623)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/build.xml 2009-01-26 08:31:22 UTC (rev 12624)
@@ -108,7 +108,6 @@
<path refid="jbpm.jpdl.classpath"/>
<path refid="glassfish.jsf.classpath"/>
<path refid="el.el.classpath"/>
- <path refid="richfaces.richfaces.classpath"/>
<path refid="facelets.facelets.classpath"/>
<path refid="portlet.portlet.classpath"/>
<path refid="jboss/portlet.bridge.classpath"/>
@@ -211,9 +210,6 @@
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-api.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-api.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-ui.jar"/>
<fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-lib.jar"/>
<fileset dir="${apache.beanutils.lib}" includes="commons-beanutils.jar"/>
<fileset dir="${apache.lang.lib}" includes="commons-lang.jar"/>
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2009-01-24 12:07:08 UTC (rev 12623)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2009-01-26 08:31:22 UTC (rev 12624)
@@ -87,19 +87,6 @@
<param-value>server</param-value>
</context-param>
- <filter>
- <display-name>Ajax4jsf Filter</display-name>
- <filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.Filter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>ajax4jsf</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- <dispatcher>FORWARD</dispatcher>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>INCLUDE</dispatcher>
- </filter-mapping>
-
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
Modified: branches/Enterprise_Portal_Platform_4_3/core-wsrp/build.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/build.xml 2009-01-24 12:07:08 UTC (rev 12623)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/build.xml 2009-01-26 08:31:22 UTC (rev 12624)
@@ -100,7 +100,6 @@
<path refid="junit.junit.classpath"/>
<path refid="glassfish.jsf.classpath"/>
<path refid="el.el.classpath"/>
- <path refid="richfaces.richfaces.classpath"/>
<path refid="facelets.facelets.classpath"/>
<path refid="portlet.portlet.classpath"/>
<path refid="jboss/portlet.bridge.classpath"/>
@@ -208,9 +207,6 @@
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-api.jar"/>
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-api.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-impl.jar"/>
- <fileset dir="${richfaces.richfaces.lib}" includes="richfaces-ui.jar"/>
<fileset dir="${build.lib}" includes="portal-wsrp-admin-lib.jar"/>
<fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-lib.jar"/>
<!--<fileset dir="${el.el.lib}" includes="el-api.jar,el-ri.jar"/>-->
15 years, 5 months
JBoss Portal SVN: r12623 - in branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal: core/impl/model/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-24 07:07:08 -0500 (Sat, 24 Jan 2009)
New Revision: 12623
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java
Log:
- JBPORTAL-2281: we do always need ChildrenCollection after all...
- Added iterator tests.
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java 2009-01-23 19:19:51 UTC (rev 12622)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java 2009-01-24 12:07:08 UTC (rev 12623)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, 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. *
@@ -40,7 +40,6 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -169,7 +168,7 @@
}
public String getDisplayName(Locale locale)
- {
+ {
LocalizedString ldisplayName = object.getDisplayName();
if (ldisplayName != null)
{
@@ -179,7 +178,7 @@
return result;
}
}
-
+
// Lazily compute the display name
if (displayNameKey == null)
{
@@ -196,7 +195,7 @@
catch (MissingResourceException ignore)
{
}
-
+
if (bundle != null)
{
try
@@ -302,15 +301,15 @@
String orderProperty2S = (String)node2.getProperties().get(ORDER);
if (orderProperty1S != null && orderProperty2S == null)
- {
+ {
return -1;
}
else if (orderProperty1S == null && orderProperty2S != null)
- {
+ {
return 1;
}
else if (orderProperty1S != null && orderProperty2S != null)
- {
+ {
float orderProperty1 = -1;
float orderProperty2 = -1;
@@ -401,10 +400,8 @@
boolean allVisible = portalAuthorizationManager.checkPermission(new PortalObjectPermission(objectNode.object.getId(), PortalObjectPermission.VIEW_RECURSIVE_ACTION));
//
- for (Iterator<PortalObject> i = tmp.iterator(); i.hasNext();)
+ for (PortalObject childObject : tmp)
{
- PortalObject childObject = (PortalObject)i.next();
-
// It is visible if the parent has recursive view enabled
boolean visible = allVisible;
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2009-01-23 19:19:51 UTC (rev 12622)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2009-01-24 12:07:08 UTC (rev 12623)
@@ -256,19 +256,26 @@
public int size()
{
- int count = 0;
-
- for (Object object : children.values())
+ if (mask != ALL_TYPES_MASK)
{
- ObjectNode childNode = (ObjectNode)object;
- PortalObjectImpl childObject = childNode.getObject();
- if (isMatchingMask(childObject, mask))
+ int count = 0;
+
+ for (Object object : children.values())
{
- count++;
+ ObjectNode childNode = (ObjectNode)object;
+ PortalObjectImpl childObject = childNode.getObject();
+ if (isMatchingMask(childObject, mask))
+ {
+ count++;
+ }
}
- }
- return count;
+ return count;
+ }
+ else
+ {
+ return children.size();
+ }
}
public Object[] toArray()
@@ -367,18 +374,10 @@
public Collection getChildren(int wantedMask)
{
- // if we want all the children, bypass ChildrenCollection
- if (wantedMask == ALL_TYPES_MASK)
- {
- return new TreeMap(objectNode.getChildren()).values();
- }
- else
- {
- // Correct eventually the mask
- final int mask = wantedMask & ALL_TYPES_MASK;
+ // Correct eventually the mask
+ final int mask = wantedMask & ALL_TYPES_MASK;
- return new ChildrenCollection(mask, objectNode.getChildren());
- }
+ return new ChildrenCollection(mask, objectNode.getChildren());
}
public String getListener()
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java 2009-01-23 19:19:51 UTC (rev 12622)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java 2009-01-24 12:07:08 UTC (rev 12623)
@@ -23,16 +23,15 @@
package org.jboss.portal.test.core.model.portal;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jboss.portal.common.junit.TransactionAssert;
+import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.portal.Context;
+import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
+import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
+import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
-import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
-import org.jboss.portal.core.model.content.ContentType;
import java.util.Collection;
@@ -46,6 +45,7 @@
private Portal p_1;
private Page p_1_1;
private Page p_1_2;
+ private static final int A_INDEX = 65;
public static TestSuite suite() throws Exception
{
@@ -56,7 +56,7 @@
public void setUp() throws Exception
{
super.setUp();
-
+
TransactionAssert.beginTransaction();
root = container.getContext("");
p_1 = root.createPortal("1");
@@ -105,6 +105,48 @@
assertEquals(p_1_1, child.getParent());
}
+ public void testIterator() throws NoSuchPortalObjectException, DuplicatePortalObjectException
+ {
+ Portal portal;
+ Page page;
+
+ TransactionAssert.beginTransaction();
+ root.destroyChild(p_1.getName());
+ char nbChildren = 20;
+ portal = root.createPortal("portal");
+ page = portal.createPage("page");
+
+ // create children, we need to convert the current index with Character.toString as default ordering results in
+ // pa10 < pa2 and in test failure
+ for (char i = A_INDEX; i < nbChildren + A_INDEX; i++)
+ {
+ // convert current index into a letter
+ String letter = Character.toString(i);
+ page.createPage("pa" + letter);
+ page.createWindow("w" + letter, ContentType.PORTLET, "foo" + letter);
+ }
+ TransactionAssert.commitTransaction();
+
+ Collection<PortalObject> children = page.getChildren(PortalObject.PAGE_MASK);
+ assertNotNull(children);
+ char i = A_INDEX;
+ String name;
+ for (PortalObject child : children)
+ {
+ name = child.getName();
+ assertEquals("pa" + Character.toString(i++), name);
+ }
+
+ children = page.getChildren(PortalObject.WINDOW_MASK);
+ assertNotNull(children);
+ i = A_INDEX;
+ for (PortalObject child : children)
+ {
+ name = child.getName();
+ assertEquals("w" + Character.toString(i++), name);
+ }
+ }
+
/*public void testPerformanceGetChildren() throws DuplicatePortalObjectException, NoSuchPortalObjectException
{
Portal portal;
15 years, 5 months