JBoss Portal SVN: r8101 - in docs: trunk/referenceGuide/en/modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-08-29 13:24:09 -0400 (Wed, 29 Aug 2007)
New Revision: 8101
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/wsrp.xml
docs/trunk/referenceGuide/en/modules/wsrp.xml
Log:
- JBPORTAL-1653: Fixed XML examples (thanks Andy!).
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/wsrp.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/wsrp.xml 2007-08-29 16:34:35 UTC (rev 8100)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/wsrp.xml 2007-08-29 17:24:09 UTC (rev 8101)
@@ -70,7 +70,7 @@
<para>
JBoss Portal provides a complete support of WSRP 1.0 standard interfaces and offers
both consumer and producer services. WSRP support is provided by the <emphasis>portal-wsrp.sar</emphasis>
- service archive, included in the main <emphasis>jboss-portal.sar</emphasis> service archive, if you've
+ service archive, included in the main <emphasis>jboss-portal.sar</emphasis> service archive, if you've
obtained JBoss Portal from a binary distribution. If you don't intend on using WSRP, we recommend that you
remove the <emphasis>portal-wspr.sar</emphasis> from the main <emphasis>jboss-portal.sar</emphasis> service
archive.</para>
@@ -242,9 +242,9 @@
<para>We will create a <emphasis>public-bea-wsrp.xml</emphasis> descriptor. Note that the actual name does not
matter as long as it ends with <emphasis>-wsrp.xml</emphasis>.
<programlisting><![CDATA[
+<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<?xml version="1.0" standalone="yes"?>
<deployments>
<deployment>
<wsrp-producer id="bea" expiration-cache="120">
@@ -254,6 +254,7 @@
<name>registration/consumerRole</name>
<lang>en</lang>
<value>public</value>
+ </property>
</registration-data>
</wsrp-producer>
</deployment>
@@ -485,9 +486,11 @@
</para>
<para>
- <programlisting><![CDATA[<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<deployments>
<deployment>
<wsrp-producer id="self" expiration-cache="300">
@@ -519,9 +522,11 @@
URLs:</para>
<para>
- <programlisting><![CDATA[<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<deployments>
<deployment>
<wsrp-producer id="MyProducer" expiration-cache="120">
@@ -548,9 +553,11 @@
data and cache expiring every minute:</para>
<para>
- <programlisting><![CDATA[<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<deployments>
<deployment>
<wsrp-producer id="AnotherProducer" expiration-cache="60">
@@ -583,10 +590,11 @@
<title>Default configuration</title>
<para>
Let's look at the default configuration:
- <programlisting><![CDATA[<!DOCTYPE producer-configuration PUBLIC
- "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE producer-configuration PUBLIC "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-producer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<producer-configuration>
<registration-configuration fullServiceDescriptionRequiresRegistration="true">
<registration-property-validator>
@@ -690,10 +698,11 @@
values for two String registration properties named "name1" and "name2" respectively. The registration
service will use the <literal>com.example.portal.SomeCustomRegistrationPolicy</literal> class for its
registration policy.
- <programlisting><![CDATA[<!DOCTYPE producer-configuration PUBLIC
- "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE producer-configuration PUBLIC "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-producer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<producer-configuration>
<registration-configuration fullServiceDescriptionRequiresRegistration="true">
<registration-policy>com.example.portal.SomeCustomRegistrationPolicy</registration-policy>
Modified: docs/trunk/referenceGuide/en/modules/wsrp.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/wsrp.xml 2007-08-29 16:34:35 UTC (rev 8100)
+++ docs/trunk/referenceGuide/en/modules/wsrp.xml 2007-08-29 17:24:09 UTC (rev 8101)
@@ -242,9 +242,9 @@
<para>We will create a <emphasis>public-bea-wsrp.xml</emphasis> descriptor. Note that the actual name does not
matter as long as it ends with <emphasis>-wsrp.xml</emphasis>.
<programlisting><![CDATA[
+<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<?xml version="1.0" standalone="yes"?>
<deployments>
<deployment>
<wsrp-producer id="bea" expiration-cache="120">
@@ -254,6 +254,7 @@
<name>registration/consumerRole</name>
<lang>en</lang>
<value>public</value>
+ </property>
</registration-data>
</wsrp-producer>
</deployment>
@@ -485,9 +486,11 @@
</para>
<para>
- <programlisting><![CDATA[<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<deployments>
<deployment>
<wsrp-producer id="self" expiration-cache="300">
@@ -519,9 +522,11 @@
URLs:</para>
<para>
- <programlisting><![CDATA[<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<deployments>
<deployment>
<wsrp-producer id="MyProducer" expiration-cache="120">
@@ -548,9 +553,11 @@
data and cache expiring every minute:</para>
<para>
- <programlisting><![CDATA[<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<deployments>
<deployment>
<wsrp-producer id="AnotherProducer" expiration-cache="60">
@@ -583,10 +590,11 @@
<title>Default configuration</title>
<para>
Let's look at the default configuration:
- <programlisting><![CDATA[<!DOCTYPE producer-configuration PUBLIC
- "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE producer-configuration PUBLIC "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-producer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<producer-configuration>
<registration-configuration fullServiceDescriptionRequiresRegistration="true">
<registration-property-validator>
@@ -690,10 +698,11 @@
values for two String registration properties named "name1" and "name2" respectively. The registration
service will use the <literal>com.example.portal.SomeCustomRegistrationPolicy</literal> class for its
registration policy.
- <programlisting><![CDATA[<!DOCTYPE producer-configuration PUBLIC
- "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE producer-configuration PUBLIC "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-producer_2_6.dtd">
-<?xml version="1.0" encoding="UTF-8"?>
+
<producer-configuration>
<registration-configuration fullServiceDescriptionRequiresRegistration="true">
<registration-policy>com.example.portal.SomeCustomRegistrationPolicy</registration-policy>
16 years, 8 months
JBoss Portal SVN: r8100 - branches/JBoss_Portal_Branch_2_6/testsuite.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-29 12:34:35 -0400 (Wed, 29 Aug 2007)
New Revision: 8100
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/build.xml
Log:
better commented out identity stuff in testsuite
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/build.xml 2007-08-29 16:16:40 UTC (rev 8099)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/build.xml 2007-08-29 16:34:35 UTC (rev 8100)
@@ -130,9 +130,11 @@
<antcall target="internal-test-module">
<param name="module" value="security"/>
</antcall>
+<!--
<antcall target="internal-test-module">
<param name="module" value="identity"/>
</antcall>
+-->
<antcall target="internal-test-module">
<param name="module" value="server"/>
</antcall>
@@ -196,8 +198,10 @@
<fileset dir="../portlet-server" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
<fileset dir="../security" includes="*.log"/>
<fileset dir="../security" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
+<!--
<fileset dir="../identity" includes="*.log"/>
<fileset dir="../identity" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
+-->
<fileset dir="../wsrp" includes="*.log"/>
<fileset dir="../wsrp" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
<!--
16 years, 8 months
JBoss Portal SVN: r8099 - branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-29 12:16:40 -0400 (Wed, 29 Aug 2007)
New Revision: 8099
Modified:
branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormPartialRefreshWindowTest.java
Log:
Build broken, common API changed
Modified: branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormPartialRefreshWindowTest.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormPartialRefreshWindowTest.java 2007-08-29 16:15:34 UTC (rev 8098)
+++ branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormPartialRefreshWindowTest.java 2007-08-29 16:16:40 UTC (rev 8099)
@@ -130,7 +130,7 @@
WindowObject window = (WindowObject)target;
assertEquals("0", window.getId());
assertEquals(async, requestContext.isAsync());
- assertEquals(new MapBuilder().put("foo", "foo_value_1").put("bar", "bar_value_1").toHashMap(), requestContext.getParameterMap());
+ assertEquals(MapBuilder.hashMap().put("foo", "foo_value_1").put("bar", "bar_value_1").get(), requestContext.getParameterMap());
return null;
case 2:
target = requestContext.getTarget();
@@ -139,7 +139,7 @@
window = (WindowObject)target;
assertEquals("0", window.getId());
assertEquals(async, requestContext.isAsync());
- assertEquals(new MapBuilder().put("foo", "foo_value_2").put("bar", "bar_value_2").toHashMap(), requestContext.getParameterMap());
+ assertEquals(MapBuilder.hashMap().put("foo", "foo_value_2").put("bar", "bar_value_2").get(), requestContext.getParameterMap());
return null;
default:
fail();
16 years, 8 months
JBoss Portal SVN: r8098 - branches/JBoss_Portal_Branch_2_6/portlet/src/main/org/jboss/portal/portlet/impl/jsr168.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-29 12:15:34 -0400 (Wed, 29 Aug 2007)
New Revision: 8098
Modified:
branches/JBoss_Portal_Branch_2_6/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
Log:
Build broken, common API changed
Modified: branches/JBoss_Portal_Branch_2_6/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java 2007-08-29 16:13:23 UTC (rev 8097)
+++ branches/JBoss_Portal_Branch_2_6/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java 2007-08-29 16:15:34 UTC (rev 8098)
@@ -105,7 +105,7 @@
if (queryString.length() > 0)
{
this.parameters = new PortletParameters(rreq.getParameterMap());
- this.parameters.putAll(QueryStringParser.parseQueryString(queryString));
+ this.parameters.putAll(QueryStringParser.getInstance().parseQueryString(queryString));
}
else
{
16 years, 8 months
JBoss Portal SVN: r8097 - modules/test/trunk/test/src/main/org/jboss/test/junit.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-29 12:13:23 -0400 (Wed, 29 Aug 2007)
New Revision: 8097
Modified:
modules/test/trunk/test/src/main/org/jboss/test/junit/POJOJunitTestTestCase.java
Log:
update test module to common changes
Modified: modules/test/trunk/test/src/main/org/jboss/test/junit/POJOJunitTestTestCase.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/test/junit/POJOJunitTestTestCase.java 2007-08-29 16:11:08 UTC (rev 8096)
+++ modules/test/trunk/test/src/main/org/jboss/test/junit/POJOJunitTestTestCase.java 2007-08-29 16:13:23 UTC (rev 8097)
@@ -37,10 +37,10 @@
{
/** . */
- private static final Map lifeCycleCalledState = new MapBuilder().put("testFoo", new Integer(1)).put("setUp", new Integer(1)).put("tearDown", new Integer(1)).toHashMap();
+ private static final Map lifeCycleCalledState = MapBuilder.hashMap().put("testFoo", new Integer(1)).put("setUp", new Integer(1)).put("tearDown", new Integer(1)).get();
/** . */
- private static final Map lifeCycleNotCalledState = new MapBuilder().put("testFoo", new Integer(1)).toHashMap();
+ private static final Map lifeCycleNotCalledState = MapBuilder.hashMap().put("testFoo", new Integer(1)).get();
public void testDeclaredPublicLifeCycle() throws Exception
{
16 years, 8 months
JBoss Portal SVN: r8096 - branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/servlet.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-29 12:11:08 -0400 (Wed, 29 Aug 2007)
New Revision: 8096
Modified:
branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/servlet/PortalServlet.java
Log:
Build broken, common API changed
Modified: branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/servlet/PortalServlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/servlet/PortalServlet.java 2007-08-29 15:53:50 UTC (rev 8095)
+++ branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/servlet/PortalServlet.java 2007-08-29 16:11:08 UTC (rev 8096)
@@ -288,7 +288,7 @@
String queryString = req.getQueryString();
if (queryString != null)
{
- queryParameterMap = QueryStringParser.parseQueryString(queryString);
+ queryParameterMap = QueryStringParser.getInstance().parseQueryString(queryString);
}
//
16 years, 8 months
JBoss Portal SVN: r8095 - trunk/core/src/main/org/jboss/portal/core/impl/model.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-29 11:53:50 -0400 (Wed, 29 Aug 2007)
New Revision: 8095
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java
Log:
JBPORTAL-1600: Dashboard also includes protected resources from 'template' on creation
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java 2007-08-29 15:51:56 UTC (rev 8094)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java 2007-08-29 15:53:50 UTC (rev 8095)
@@ -22,28 +22,30 @@
******************************************************************************/
package org.jboss.portal.core.impl.model;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
+import java.util.Iterator;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
import org.jboss.portal.core.model.CustomizationManager;
+import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
+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.Portal;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.PortalObjectPermission;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
-import org.jboss.portal.core.model.portal.PortalObjectContainer;
-import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
-import org.jboss.portal.core.model.portal.Context;
import org.jboss.portal.core.model.portal.PortalObjectPath;
-import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
-import org.jboss.portal.core.model.content.Content;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
-import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.core.model.portal.PortalObjectPermission;
+import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.User;
-import org.jboss.logging.Logger;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -285,7 +287,9 @@
Portal templatePortal = (Portal)portalObjectContainer.getObject(TEMPLATE_ID);
// Copy the template portal
- dashboardPortal = (Portal)templatePortal.copy(dashboardContext, userId, true);
+ dashboardPortal = (Portal)templatePortal.copy(dashboardContext, userId, false);
+ copy(templatePortal, dashboardContext.getChild(userId));
+
}
}
catch (DuplicatePortalObjectException e)
@@ -298,6 +302,36 @@
return dashboardPortal;
}
+ private void copy(PortalObject from, PortalObject to)
+ {
+ PortalAuthorizationManager pam = pamf.getManager();
+ Iterator it = from.getChildren().iterator();
+ {
+ while (it.hasNext())
+ {
+ PortalObject portalObject = (PortalObject)it.next();
+ try
+ {
+ PortalObjectPermission perm = new PortalObjectPermission(portalObject.getId(), PortalObjectPermission.VIEW_MASK);
+ if (pam.checkPermission(perm))
+ {
+ portalObject.copy(to, portalObject.getName(), false);
+ }
+ copy(portalObject, to.getChild(portalObject.getName()));
+ }
+ catch (IllegalArgumentException e)
+ {
+ e.printStackTrace();
+ }
+ catch (DuplicatePortalObjectException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+
public void destroyDashboard(String userId)
{
try
16 years, 8 months
JBoss Portal SVN: r8094 - branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-29 11:51:56 -0400 (Wed, 29 Aug 2007)
New Revision: 8094
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java
Log:
JBPORTAL-1600: Dashboard also includes protected resources from 'template' on creation
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java 2007-08-29 14:48:42 UTC (rev 8093)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java 2007-08-29 15:51:56 UTC (rev 8094)
@@ -22,28 +22,30 @@
******************************************************************************/
package org.jboss.portal.core.impl.model;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
+import java.util.Iterator;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
import org.jboss.portal.core.model.CustomizationManager;
+import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
+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.Portal;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.PortalObjectPermission;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
-import org.jboss.portal.core.model.portal.PortalObjectContainer;
-import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
-import org.jboss.portal.core.model.portal.Context;
import org.jboss.portal.core.model.portal.PortalObjectPath;
-import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
-import org.jboss.portal.core.model.content.Content;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
-import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.core.model.portal.PortalObjectPermission;
+import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.User;
-import org.jboss.logging.Logger;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -285,7 +287,9 @@
Portal templatePortal = (Portal)portalObjectContainer.getObject(TEMPLATE_ID);
// Copy the template portal
- dashboardPortal = (Portal)templatePortal.copy(dashboardContext, userId, true);
+ dashboardPortal = (Portal)templatePortal.copy(dashboardContext, userId, false);
+ copy(templatePortal, dashboardContext.getChild(userId));
+
}
}
catch (DuplicatePortalObjectException e)
@@ -298,6 +302,36 @@
return dashboardPortal;
}
+ private void copy(PortalObject from, PortalObject to)
+ {
+ PortalAuthorizationManager pam = pamf.getManager();
+ Iterator it = from.getChildren().iterator();
+ {
+ while (it.hasNext())
+ {
+ PortalObject portalObject = (PortalObject)it.next();
+ try
+ {
+ PortalObjectPermission perm = new PortalObjectPermission(portalObject.getId(), PortalObjectPermission.VIEW_MASK);
+ if (pam.checkPermission(perm))
+ {
+ portalObject.copy(to, portalObject.getName(), false);
+ }
+ copy(portalObject, to.getChild(portalObject.getName()));
+ }
+ catch (IllegalArgumentException e)
+ {
+ e.printStackTrace();
+ }
+ catch (DuplicatePortalObjectException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+
public void destroyDashboard(String userId)
{
try
16 years, 8 months
JBoss Portal SVN: r8093 - in modules/common/trunk/common: src/main/org/jboss/portal/common/http and 5 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-29 10:48:42 -0400 (Wed, 29 Aug 2007)
New Revision: 8093
Added:
modules/common/trunk/common/src/main/org/jboss/portal/test/common/http/
modules/common/trunk/common/src/main/org/jboss/portal/test/common/http/QueryStringParserTestCase.java
Modified:
modules/common/trunk/common/build.xml
modules/common/trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java
modules/common/trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java
modules/common/trunk/common/src/main/org/jboss/portal/common/text/FastURLDecoder.java
modules/common/trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java
modules/common/trunk/common/src/main/org/jboss/portal/test/common/text/FastURLDecoderTestCase.java
Log:
- improved the FastURLDecoder to provide by default a non strict mode which allows the parsing of chars other than the alpha numeric / special symbols / % encoded values. Those chars are just appended to the CharWriter
- Reimplemented the query string parser to provide a more tolerant implementation
- Added test cases for the query string parser to assert its behavior
Modified: modules/common/trunk/common/build.xml
===================================================================
--- modules/common/trunk/common/build.xml 2007-08-29 10:18:40 UTC (rev 8092)
+++ modules/common/trunk/common/build.xml 2007-08-29 14:48:42 UTC (rev 8093)
@@ -208,6 +208,7 @@
</x-sysproperty>
<x-test>
+ <test todir="${test.reports}" name="org.jboss.portal.test.common.http.QueryStringParserTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.text.FastURLDecoderTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.text.CharBufferTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.text.TextToolsTestCase"/>
Modified: modules/common/trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java 2007-08-29 10:18:40 UTC (rev 8092)
+++ modules/common/trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java 2007-08-29 14:48:42 UTC (rev 8093)
@@ -23,6 +23,12 @@
package org.jboss.portal.common.http;
import org.jboss.portal.common.net.URLTools;
+import org.jboss.portal.common.text.CharEncoder;
+import org.jboss.portal.common.text.FastURLDecoder;
+import org.jboss.portal.common.text.CharBuffer;
+import org.jboss.portal.common.text.EncodingException;
+import org.jboss.portal.common.util.ParameterMap;
+import org.apache.log4j.Logger;
import java.util.Collections;
import java.util.HashMap;
@@ -30,20 +36,98 @@
import java.util.StringTokenizer;
/**
+ * A parser for query string for the HTTP protocol. This class is thread safe.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7379 $
*/
public class QueryStringParser
{
+ /** . */
+ private static QueryStringParser DEFAULT_PARSER = new QueryStringParser();
+
+ public static QueryStringParser getInstance()
+ {
+ return DEFAULT_PARSER;
+ }
+
+ /** . */
+ private static final Logger log = Logger.getLogger(QueryStringParser.class);
+
+ /** . */
+ private static final int LOOKUP = 0;
+
+ /** . */
+ private static final int INVALID_CHUNK = 1;
+
+ /** . */
+ private static final int PARAM_NAME = 2;
+
+ /** . */
+ private static final int PARAM_VALUE = 3;
+
+ /** . */
+ private CharEncoder parameterDecoder;
+
/**
+ * Create a new parser with the specified parameter decoder.
+ *
+ * @param parameterDecoder the parameter decoder
+ * @throws IllegalArgumentException if the decoder is null
+ */
+ public QueryStringParser(CharEncoder parameterDecoder) throws IllegalArgumentException
+ {
+ if (parameterDecoder == null)
+ {
+ throw new IllegalArgumentException("No parameter decoder");
+ }
+ this.parameterDecoder = parameterDecoder;
+ }
+
+ /**
+ * Creates a new parser with a decoder that will decode x-www-formurlencoded parameters with the
+ * UTF-8 charset.
+ */
+ public QueryStringParser()
+ {
+ this(FastURLDecoder.getUTF8Instance());
+ }
+
+ public CharEncoder getParameterDecoder()
+ {
+ return parameterDecoder;
+ }
+
+ private void append(ParameterMap parameterMap, String parameterName, String parameterValue)
+ {
+ String[] values = parameterMap.getValues(parameterName);
+
+ //
+ if (values == null)
+ {
+ values = new String[]{parameterValue};
+ }
+ else
+ {
+ String[] tmp = new String[values.length + 1];
+ System.arraycopy(values, 0, tmp, 0, values.length);
+ values = tmp;
+ values[values.length - 1] = parameterValue;
+ }
+
+ //
+ parameterMap.setValues(parameterName, values);
+ }
+
+ /**
* Parse the query string and build an unmodifiable parameter map of it.
*
* @param queryString the non null query string
* @return a <String,String[]> map
* @throws IllegalArgumentException if the query string is null
*/
- public static Map parseQueryString(String queryString) throws IllegalArgumentException
+ public ParameterMap parseQueryString(String queryString) throws IllegalArgumentException
{
if (queryString == null)
{
@@ -51,53 +135,134 @@
}
//
- Map result = Collections.EMPTY_MAP;
+ // Map result = Collections.EMPTY_MAP;
- //
- for (StringTokenizer tokenizer = new StringTokenizer(queryString, "&"); tokenizer.hasMoreTokens();)
- {
- String token = tokenizer.nextToken();
- int pos = token.indexOf('=');
- if (pos > 0)
- {
- // Get name and value
- String encodedName = token.substring(0, pos);
- String encodedValue = token.substring(pos + 1, token.length());
+ ParameterMap parameterMap = new ParameterMap();
- // Decode properly
- String name = URLTools.decodeXWWWFormURL(encodedName);
- String value = URLTools.decodeXWWWFormURL(encodedValue);
+ String encodedName = null;
+ CharBuffer buffer = new CharBuffer(50);
- // Put the values in the result map
- String[] values = (String[])result.get(name);
- if (values == null)
- {
- values = new String[1];
- }
- else
- {
- String[] tmp = new String[values.length + 1];
- System.arraycopy(values, 0, tmp, 0, values.length);
- values = tmp;
- }
- values[values.length - 1] = value;
- // Replace the empty map if necessary with a real hashmap
- if (result.isEmpty())
- {
- result = new HashMap();
- }
- result.put(name, values);
+ int pos = 0;
+ int len = queryString.length();
+ int state = LOOKUP;
+ while (true)
+ {
+ char c;
+ if (pos < len)
+ {
+ c = queryString.charAt(pos++);
}
+ else if (pos == len)
+ {
+ c = '&';
+ pos++;
+ }
else
{
- // Not well formed
- // -1 mean we have just a parameter name
- // 0 means we have an empty name
+ break;
}
+
+ //
+ switch(state)
+ {
+ case LOOKUP:
+ if (c == '&')
+ {
+ // Do nothing
+ }
+ else if (c == '=')
+ {
+ state = INVALID_CHUNK;
+ }
+ else
+ {
+ state = PARAM_NAME;
+ buffer.append(c);
+ }
+ break;
+ case PARAM_NAME:
+ if (c == '&')
+ {
+ String tmp = buffer.asString();
+
+ //
+ try
+ {
+ parameterDecoder.encode(tmp, buffer);
+ append(parameterMap, buffer.asString(false), "");
+ }
+ catch (EncodingException e)
+ {
+ log.debug("Could not decode parameter name " + tmp, e);
+ }
+
+ //
+ buffer.reset();
+ state = LOOKUP;
+ }
+ else if (c == '=')
+ {
+ encodedName = buffer.asString();
+ buffer.reset();
+ state = PARAM_VALUE;
+ }
+ else
+ {
+ buffer.append(c);
+ }
+ break;
+ case PARAM_VALUE:
+ if (c == '&')
+ {
+
+ //
+ try
+ {
+ // Save value
+ String encodedValue = buffer.asString();
+
+ // Decode parameter name
+ parameterDecoder.encode(encodedName, buffer);
+ String name = buffer.asString(false);
+
+ // Now decode parameter value
+ try
+ {
+ buffer.reset();
+ parameterDecoder.encode(encodedValue, buffer);
+ String value = buffer.asString();
+ append(parameterMap, name, value);
+ }
+ catch (EncodingException e)
+ {
+ log.debug("Could not decode parameter value " + encodedValue, e);
+ }
+ }
+ catch (EncodingException e)
+ {
+ log.debug("Could not decode parameter name " + encodedName, e);
+ }
+
+ //
+ buffer.reset();
+ state = LOOKUP;
+ }
+ else
+ {
+ buffer.append(c);
+ }
+ break;
+ case INVALID_CHUNK:
+ if (c == '&')
+ {
+ state = LOOKUP;
+ }
+ break;
+ }
}
//
- return result.isEmpty() ? result : Collections.unmodifiableMap(result);
+ return parameterMap;
}
}
Modified: modules/common/trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java 2007-08-29 10:18:40 UTC (rev 8092)
+++ modules/common/trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java 2007-08-29 14:48:42 UTC (rev 8093)
@@ -132,9 +132,19 @@
public String asString()
{
- return new String(buffer, 0, length);
+ return asString(true);
}
+ public String asString(boolean reset)
+ {
+ String s = new String(buffer, 0, length);
+ if (reset)
+ {
+ reset();
+ }
+ return s;
+ }
+
public int getCapacity()
{
return buffer.length;
Modified: modules/common/trunk/common/src/main/org/jboss/portal/common/text/FastURLDecoder.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/common/text/FastURLDecoder.java 2007-08-29 10:18:40 UTC (rev 8092)
+++ modules/common/trunk/common/src/main/org/jboss/portal/common/text/FastURLDecoder.java 2007-08-29 14:48:42 UTC (rev 8093)
@@ -30,14 +30,28 @@
{
/** . */
- private static final FastURLDecoder INSTANCE = new FastURLDecoder(CharToByteEncoder.Generic.UTF8);
+ private static final FastURLDecoder UTF8 = new FastURLDecoder(CharToByteEncoder.Generic.UTF8);
- public static FastURLDecoder getInstance()
+ /** . */
+ private static final FastURLDecoder UTF8_STRICT = new FastURLDecoder(CharToByteEncoder.Generic.UTF8, true);
+
+ public static FastURLDecoder getUTF8Instance()
{
- return INSTANCE;
+ return UTF8;
}
+ public static FastURLDecoder getUTF8StrictInstance()
+ {
+ return UTF8_STRICT;
+ }
+
/** . */
+ private static final char FROM = 0;
+
+ /** . */
+ private static final char TO = (char)0x10FFFD;
+
+ /** . */
private static final int AS_IS = 0;
/** . */
@@ -50,7 +64,7 @@
private static final int ERROR = 3;
/** . */
- private final LookupNonTerm root = new LookupNonTerm();
+ private final LookupNonTerm root;
/** . */
private final int[] decisions;
@@ -58,14 +72,21 @@
/** . */
private final int[][] conversions;
+ /** . */
+ private final boolean strict;
+
public FastURLDecoder(CharToByteEncoder encoder)
{
- this(encoder, (char)0, (char)0x10FFFD);
+ this(encoder, false);
}
- public FastURLDecoder(CharToByteEncoder encoder, char from, char to)
+ public FastURLDecoder(CharToByteEncoder encoder, boolean strict)
{
- for (char c = from;c <= to;c++)
+ this.strict = strict;
+
+ //
+ root = new LookupNonTerm();
+ for (char c = FROM;c <= TO;c++)
{
byte[] v = encoder.encode(c);
LookupNonTerm node = root;
@@ -134,6 +155,7 @@
break;
default:
decisions[i] = ERROR;
+ break;
}
}
}
@@ -284,11 +306,24 @@
}
break;
case ERROR:
- throw new MalformedInputException("Cannot decode char " + c);
+ if (strict)
+ {
+ throw new MalformedInputException("Cannot decode char " + c);
+ }
+ else
+ {
+ tmp.append(c);
+ }
+ break;
}
}
}
+ public boolean isStrict()
+ {
+ return strict;
+ }
+
private static class LookupNode
{
}
Modified: modules/common/trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java 2007-08-29 10:18:40 UTC (rev 8092)
+++ modules/common/trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java 2007-08-29 14:48:42 UTC (rev 8093)
@@ -36,14 +36,43 @@
{
/** . */
- private HashMap map;
+ private final Map map;
- public MapBuilder()
+ private MapBuilder(Map map)
{
- this.map = new HashMap();
+ if (map == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.map = map;
}
/**
+ * Creates a new instance.
+ *
+ * @return a new instance
+ */
+ public static MapBuilder hashMap()
+ {
+ return new MapBuilder(new HashMap());
+ }
+
+ /**
+ * Creates a new instance.
+ *
+ * @return a new instance
+ */
+ public static MapBuilder linkedHashMap()
+ {
+ return new MapBuilder(new LinkedHashMap());
+ }
+
+ public static MapBuilder create(Map map)
+ {
+ return new MapBuilder(map);
+ }
+
+ /**
* Add the object to the collection.
*
* @param key the key
@@ -68,23 +97,8 @@
return this;
}
- /**
- * Return a set build from the collection.
- *
- * @return a set
- */
- public HashMap toHashMap()
+ public Map get()
{
return map;
}
-
- /**
- * Return a list build from the collection.
- *
- * @return a list
- */
- public LinkedHashMap toLinkedHashMap()
- {
- return new LinkedHashMap(map);
- }
}
Added: modules/common/trunk/common/src/main/org/jboss/portal/test/common/http/QueryStringParserTestCase.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/test/common/http/QueryStringParserTestCase.java (rev 0)
+++ modules/common/trunk/common/src/main/org/jboss/portal/test/common/http/QueryStringParserTestCase.java 2007-08-29 14:48:42 UTC (rev 8093)
@@ -0,0 +1,203 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.common.http;
+
+import junit.framework.TestCase;
+import org.jboss.portal.common.http.QueryStringParser;
+import org.jboss.portal.common.util.MapBuilder;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class QueryStringParserTestCase extends TestCase
+{
+
+ /** . */
+ private final QueryStringParser parser = new QueryStringParser();
+
+ public void testConstructorThrowsIAE()
+ {
+ try
+ {
+ new QueryStringParser(null);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
+ public void testParseThrowsIAE()
+ {
+ try
+ {
+ QueryStringParser.getInstance().parseQueryString(null);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
+ public void testEmpty()
+ {
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString(""));
+ }
+
+ public void testOneParam()
+ {
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("f"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("f="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"b"}).get(), parser.parseQueryString("f=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"bar"}).get(), parser.parseQueryString("f=bar"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("foo"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("foo="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"b"}).get(), parser.parseQueryString("foo=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar"}).get(), parser.parseQueryString("foo=bar"));
+ }
+
+ public void testTwoValues()
+ {
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"","bar2"}).get(), parser.parseQueryString("f&f=bar2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"","bar2"}).get(), parser.parseQueryString("f=&f=bar2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"b","bar2"}).get(), parser.parseQueryString("f=b&f=bar2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"bar","bar2"}).get(), parser.parseQueryString("f=bar&f=bar2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"","bar2"}).get(), parser.parseQueryString("foo&foo=bar2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"","bar2"}).get(), parser.parseQueryString("foo=&foo=bar2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"b","bar2"}).get(), parser.parseQueryString("foo=b&foo=bar2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar","bar2"}).get(), parser.parseQueryString("foo=bar&foo=bar2"));
+
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"bar2",""}).get(), parser.parseQueryString("f=bar2&f"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"bar2",""}).get(), parser.parseQueryString("f=bar2&f="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"bar2","b"}).get(), parser.parseQueryString("f=bar2&f=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"bar2","bar"}).get(), parser.parseQueryString("f=bar2&f=bar"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar2",""}).get(), parser.parseQueryString("foo=bar2&foo"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar2",""}).get(), parser.parseQueryString("foo=bar2&foo="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar2","b"}).get(), parser.parseQueryString("foo=bar2&foo=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar2","bar"}).get(), parser.parseQueryString("foo=bar2&foo=bar"));
+ }
+
+ public void testEncodedValue()
+ {
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{" "}).get(), parser.parseQueryString("foo=+"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"."}).get(), parser.parseQueryString("foo=."));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"-"}).get(), parser.parseQueryString("foo=-"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"*"}).get(), parser.parseQueryString("foo=*"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"_"}).get(), parser.parseQueryString("foo=_"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"/"}).get(), parser.parseQueryString("foo=%2F"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"/"}).get(), parser.parseQueryString("foo=/"));
+ }
+
+ public void testMalformedValue()
+ {
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("foo=%2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("foo&foo=%2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar"}).get(), parser.parseQueryString("foo=bar&foo=%2"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("foo=%2&foo"));
+ }
+
+ public void testTwoParams()
+ {
+ assertEquals(MapBuilder.create(new ParameterMap()).put("x", new String[]{"y"}).put("f", new String[]{""}).get(), parser.parseQueryString("x=y&f"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("x", new String[]{"y"}).put("f", new String[]{""}).get(), parser.parseQueryString("x=y&f="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("x", new String[]{"y"}).put("f", new String[]{"b"}).get(), parser.parseQueryString("x=y&f=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("x", new String[]{"y"}).put("f", new String[]{"bar"}).get(), parser.parseQueryString("x=y&f=bar"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("x", new String[]{"y"}).put("foo", new String[]{""}).get(), parser.parseQueryString("x=y&foo"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("x", new String[]{"y"}).put("foo", new String[]{""}).get(), parser.parseQueryString("x=y&foo="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("x", new String[]{"y"}).put("foo", new String[]{"b"}).get(), parser.parseQueryString("x=y&foo=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("x", new String[]{"y"}).put("foo", new String[]{"bar"}).get(), parser.parseQueryString("x=y&foo=bar"));
+ }
+
+ public void testValueContainingEqual()
+ {
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"b=j"}).get(), parser.parseQueryString("f=b=j"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"bar=j"}).get(), parser.parseQueryString("f=bar=j"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"b=juu"}).get(), parser.parseQueryString("f=b=juu"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"bar=juu"}).get(), parser.parseQueryString("f=bar=juu"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"b=j"}).get(), parser.parseQueryString("foo=b=j"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar=j"}).get(), parser.parseQueryString("foo=bar=j"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"b=juu"}).get(), parser.parseQueryString("foo=b=juu"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar=juu"}).get(), parser.parseQueryString("foo=bar=juu"));
+ }
+
+ public void testInvalidChunck()
+ {
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("="));
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("=x"));
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("=x="));
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("=x=y"));
+ }
+
+ public void testInvalidChunckWithAmpersand()
+ {
+ //
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("=&"));
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("=x&"));
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("=x=&"));
+ assertEquals(MapBuilder.create(new ParameterMap()).get(), parser.parseQueryString("=x=y&"));
+
+ //
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("=&f"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("=x&f"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("=x=&f"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("=x=y&f"));
+
+ //
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("=&f="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("=x&f="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("=x=&f="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{""}).get(), parser.parseQueryString("=x=y&f="));
+
+ //
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"b"}).get(), parser.parseQueryString("=&f=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"b"}).get(), parser.parseQueryString("=x&f=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"b"}).get(), parser.parseQueryString("=x=&f=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("f", new String[]{"b"}).get(), parser.parseQueryString("=x=y&f=b"));
+
+ //
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("=&foo"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("=x&foo"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("=x=&foo"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("=x=y&foo"));
+
+ //
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("=&foo="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("=x&foo="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("=x=&foo="));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{""}).get(), parser.parseQueryString("=x=y&foo="));
+
+ //
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"b"}).get(), parser.parseQueryString("=&foo=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"b"}).get(), parser.parseQueryString("=x&foo=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"b"}).get(), parser.parseQueryString("=x=&foo=b"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"b"}).get(), parser.parseQueryString("=x=y&foo=b"));
+
+ //
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar"}).get(), parser.parseQueryString("=&foo=bar"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar"}).get(), parser.parseQueryString("=x&foo=bar"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar"}).get(), parser.parseQueryString("=x=&foo=bar"));
+ assertEquals(MapBuilder.create(new ParameterMap()).put("foo", new String[]{"bar"}).get(), parser.parseQueryString("=x=y&foo=bar"));
+ }
+}
Modified: modules/common/trunk/common/src/main/org/jboss/portal/test/common/text/FastURLDecoderTestCase.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/test/common/text/FastURLDecoderTestCase.java 2007-08-29 10:18:40 UTC (rev 8092)
+++ modules/common/trunk/common/src/main/org/jboss/portal/test/common/text/FastURLDecoderTestCase.java 2007-08-29 14:48:42 UTC (rev 8093)
@@ -39,7 +39,7 @@
public void testEncodeThrowsIAE() throws Exception
{
- CharEncoder encoder = FastURLDecoder.getInstance();
+ CharEncoder encoder = FastURLDecoder.getUTF8Instance();
try
{
encoder.encode(new char[10], -1, 0, new CharBuffer());
@@ -134,7 +134,7 @@
public void testEncode() throws Exception
{
- FastURLDecoder encoder = FastURLDecoder.getInstance();
+ FastURLDecoder encoder = FastURLDecoder.getUTF8Instance();
StringBuffer tmp = new StringBuffer();
for (int i = 0;i < 512;i++)
{
@@ -149,7 +149,12 @@
public void testEncodeMalformedInput()
{
- FastURLDecoder encoder = FastURLDecoder.getInstance();
+ testEncodeMalformedInput(FastURLDecoder.getUTF8StrictInstance(), true);
+ testEncodeMalformedInput(FastURLDecoder.getUTF8Instance(), false);
+ }
+
+ private void testEncodeMalformedInput(FastURLDecoder encoder, boolean strict)
+ {
try
{
encoder.encode("%0T", new CharBuffer());
@@ -198,21 +203,39 @@
catch (MalformedInputException expected)
{
}
- try
+
+ //
+ if (strict)
{
- encoder.encode(";", new CharBuffer());
- fail("Was expecting a malformed input exception");
+ try
+ {
+ encoder.encode(";", new CharBuffer());
+ fail("Was expecting a malformed input exception");
+ }
+ catch (MalformedInputException expected)
+ {
+ }
+ try
+ {
+ encoder.encode("\u0100", new CharBuffer());
+ fail("Was expecting a malformed input exception");
+ }
+ catch (MalformedInputException expected)
+ {
+ }
}
- catch (MalformedInputException expected)
+ else
{
+ CharBuffer tmp = new CharBuffer();
+
+ //
+ encoder.encode(";", tmp);
+ assertEquals(";", tmp.asString());
+
+ //
+ tmp.reset();
+ encoder.encode("\u0100", tmp);
+ assertEquals("\u0100", tmp.asString());
}
- try
- {
- encoder.encode("\u0100", new CharBuffer());
- fail("Was expecting a malformed input exception");
- }
- catch (MalformedInputException expected)
- {
- }
}
}
16 years, 8 months
JBoss Portal SVN: r8092 - in docs/trunk/referenceGuide/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-29 06:18:40 -0400 (Wed, 29 Aug 2007)
New Revision: 8092
Removed:
docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package.gif
Modified:
docs/trunk/referenceGuide/en/modules/tutorials.xml
Log:
Updated reference documentation about JSF tutorials
Deleted: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package.gif
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/modules/tutorials.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/tutorials.xml 2007-08-29 08:41:42 UTC (rev 8091)
+++ docs/trunk/referenceGuide/en/modules/tutorials.xml 2007-08-29 10:18:40 UTC (rev 8092)
@@ -10,6 +10,11 @@
<surname>Laprun</surname>
<email>chris.laprun(a)jboss.com</email>
</author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ <email>thomas.heute(a)jboss.com</email>
+ </author>
</chapterinfo>
<title>Portlet Primer</title>
<sect1 id="portlet_primer">
@@ -706,14 +711,193 @@
</para>
</sect3>
</sect2>
+ <sect2 id="sunri_42x">
+ <title>A simple Sun's JSF Reference Implementation (RI) portlet on JBoss AS 4.2.x</title>
+ <sect3>
+ <title>Introduction</title>
+ <para>This section will introduce the reader to deploying a simple JSF portlet in JBoss Portal, using
+ Apache's MyFaces JSF implementation on JBoss AS 4.2.x. It requires you download the HelloWorldJSFSunRIPortlet
+ from PortletSwap.com, using this link:
+ <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...">http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...</ulink>.
+ </para>
+ </sect3>
+ <sect3>
+ <title>Package Content</title>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/tutorials/jsf_portlet/package_sunri.png" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ Like a typical JSF application, we also package our faces-config.xml that defines our
+ managed-beans, converters, validators, navigation rules, etc...
+ <note>JBoss Application Server version 4.2.x bundles Sun's JSF Reference Implementation (RI) in
+ <literal>JBOSS_HOME/server/default/deploy/jboss-web.deployer/jsf-libs/</literal>. As a result,
+ you do not need to package Sun RI's libraries with your portlet application.
+ </note>
+ </para>
+ <para>For the sake of brevity, we only discuss the <literal>portlet.xml</literal> and
+ <literal>faces-config.xml</literal> descriptors here. For discussion on the other descriptors, please
+ view <xref linkend="first_portlet_descriptors"/> or the chapter on descriptors:
+ <xref linkend="descriptors_portlet"/>.
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/tutorials/jsf_portlet/package_sunri.png" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <itemizedlist>
+ <listitem>
+ <para><literal>portlet.xml</literal>
+<programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <portlet-name>HelloWorldJSFPortlet</portlet-name>
+ <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
+ <init-param>
+ <name>com.sun.faces.portlet.INIT_VIEW</name>
+ <value>/WEB-INF/jsp/index.jsp</value>
+ </init-param>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>HelloWorld JSF Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>]]></programlisting>
+ This file must adhere to its definition in the Portlet Specification. You may define more than
+ one portlet application in this file. Now let's look at the portions that deal with our use of
+ JSF:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <programlisting><![CDATA[<portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>]]></programlisting>
+ Here we specify that com.sun.faces.portlet.FacesPortlet will handle all requests/responses from our
+ users. This class is part of jsf-portlet.jar as explained later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ We need to initialize the portlet with a default view page for it to render, much like
+ a welcome page:
+ <programlisting><![CDATA[<init-param>
+ <name>com.sun.faces.portlet.INIT_VIEW</name>
+ <value>/WEB-INF/jsp/index.jsp</value>
+</init-param>]]></programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para><literal>faces-config.xml</literal>
+<programlisting><![CDATA[<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <description>Basic UserBean</description>
+ <managed-bean-name>user</managed-bean-name>
+ <managed-bean-class>org.jboss.portlet.hello.bean.User</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>done</from-outcome>
+ <to-view-id>/WEB-INF/jsp/result.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+</faces-config>]]></programlisting>
+ There is nothing special about the <literal>faces-config.xml</literal> file included here. This
+ application would work just as well outside of a portlet as it would inside a portlet container.
+ In the above lines, we define a basic <literal>User</literal> Bean and a navigation rule to
+ handle the submittal of the original form on <literal>index.jsp</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para><literal>web.xml</literal>
+<programlisting><![CDATA[<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+</web-app>]]></programlisting>
+ For the Sun RI, this definition is mandatory to associate jsf extension with the faces servlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para><literal>jsf-portlet.jar</literal> This library that can be downloaded here: <ulink url="https://jsfportletbridge.dev.java.net/servlets/ProjectDocumentList">https://jsfportletbridge.dev.java.net/servlets/ProjectDocumentList</ulink>
+ contains the classes for the JSF-Portlet bridge. Since they are not included with the JSF
+ implementation (unlike myfaces) neither in JBoss AS, it is required to have this library available
+ in the package.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect3>
+ <!--
+ <sect3>
+ <title>JSP files</title>
+ <para>TODO!!</para>
+ </sect3>
+ -->
+ <sect3>
+ <title>Building and deploying your portlet</title>
+ <para>If you have downloaded the sample, you can execute the build.xml with ant or inside your IDE.
+ Executing <literal>ant</literal> will compile all source files and produce a
+ <literal>helloworldjspportlet.war</literal> file in a way similar to what we saw in
+ <xref linkend="first_portlet_build"/>.
+ </para>
+ <!--
+ <para>
+ The <literal>explode</literal> target will produce the following:
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/tutorials/jsf_portlet/exploded.gif" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ -->
+ <para>
+ Deploying the portlet is as easy as copying/moving the <literal>helloworldjspportlet.war</literal> file
+ to the server <literal>deploy</literal> directory. We can then see our portlet on the Portal default
+ page (<ulink url="http://localhost:8080/portal/">http://localhost:8080/portal/</ulink>):
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/tutorials/jsf_portlet/output.png" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </sect3>
+ </sect2>
<sect2 id="myfaces_40x">
- <title>A Simple MyFaces JSF Portlet on JBoss AS 4.0.x</title>
+ <title>A simple MyFaces JSF Portlet on JBoss AS 4.0.5+</title>
<sect3>
<title>Introduction</title>
<para>This section will introduce the reader to deploying a simple JSF portlet in JBoss Portal, using
- Apache's MyFaces JSF implementation on JBoss AS 4.0.x. It requires you download the HelloWorldJSFPortlet
- from PortletSwap.com, using this
- <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">link</ulink>.
+ Apache's MyFaces JSF implementation on JBoss AS 4.0.5+. It requires you download the HelloWorldJSFMyFacesPortlet
+ from PortletSwap.com, using this link:
+ <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...">http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...</ulink>.
</para>
</sect3>
<sect3>
@@ -721,7 +905,7 @@
<para>
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/tutorials/jsf_portlet/package.gif" valign="middle"/>
+ <imagedata align="center" fileref="images/tutorials/jsf_portlet/package_myfaces.png" valign="middle"/>
</imageobject>
</mediaobject>
Like a typical JSF application, we also package our faces-config.xml that defines our
@@ -737,7 +921,7 @@
<xref linkend="descriptors_portlet"/>.
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/tutorials/jsf_portlet/package.gif" valign="middle"/>
+ <imagedata align="center" fileref="images/tutorials/jsf_portlet/package_myfaces.png" valign="middle"/>
</imageobject>
</mediaobject>
<itemizedlist>
@@ -821,17 +1005,20 @@
</itemizedlist>
</para>
</sect3>
+ <!--
<sect3>
<title>JSP files</title>
<para>TODO!!</para>
</sect3>
+ -->
<sect3>
<title>Building and deploying your portlet</title>
<para>If you have downloaded the sample, you can execute the build.xml with ant or inside your IDE.
- Executing the <literal>deploy</literal> target will compile all source files and produce a
- <literal>helloworldjspportlet.war</literal> file in a way similar to what we saw in
+ Executing <literal>ant</literal> will compile all source files and produce a
+ <literal>helloworldjsfportlet.war</literal> file in a way similar to what we saw in
<xref linkend="first_portlet_build"/>.
</para>
+ <!--
<para>
The <literal>explode</literal> target will produce the following:
<mediaobject>
@@ -840,6 +1027,7 @@
</imageobject>
</mediaobject>
</para>
+ -->
<para>
Deploying the portlet is as easy as copying/moving the <literal>helloworldjspportlet.war</literal> file
to the server <literal>deploy</literal> directory. We can then see our portlet on the Portal default
@@ -883,9 +1071,5 @@
</mediaobject>
</para>
</sect2>
- <sect2>
- <title>JSF Portlet using Sun's JSF Reference Implementation (RI)</title>
- <para>TODO</para>
- </sect2>
</sect1>
</chapter>
\ No newline at end of file
16 years, 8 months