Author: chris.laprun(a)jboss.com
Date: 2008-02-05 16:52:39 -0500 (Tue, 05 Feb 2008)
New Revision: 9786
Added:
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/web.xml
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/web.xml
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java
modules/portlet/trunk/test/src/test/build.xml
Log:
- Define use of public render parameters in demo portlets.
- Package demo portlets.
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java 2008-02-05
21:10:46 UTC (rev 9785)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java 2008-02-05
21:52:39 UTC (rev 9786)
@@ -50,18 +50,14 @@
{
protected static final String A = "<a";
private static final String A_TARGET_BLANK = "<a
target='_blank'";
- private static final String ZIP = "zip";
+ private static final String ZIP = "zipcode";
private static final String SAN_FRAN = "94102";
private static final String GOOGLE = "http://www.google.com/search?q=";
@Override
protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
{
- String zip = renderRequest.getParameter(ZIP);
- if (zip == null)
- {
- zip = renderRequest.getPreferences().getValue(ZIP, SAN_FRAN);
- }
+ String zip = getZipCode(renderRequest);
String query = getQueryString(zip);
@@ -109,6 +105,16 @@
}
}
+ protected String getZipCode(RenderRequest renderRequest)
+ {
+ String zip = renderRequest.getParameter(ZIP);
+ if (zip == null)
+ {
+ zip = renderRequest.getPreferences().getValue(ZIP, SAN_FRAN);
+ }
+ return zip;
+ }
+
@Override
protected void doEdit(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
{
@@ -120,7 +126,7 @@
"\n" +
" <form method='post' action='" +
renderResponse.createActionURL() + "'\n" +
" <font class='portlet-font'>Zip
Code:</font><br/>\n" +
- " <input class='portlet-form-input-field'
type='text' value='' size='12' name='zip'>\n" +
+ " <input class='portlet-form-input-field'
type='text' value='' size='12' name='" + ZIP +
"'/>\n" +
" <br/>\n" +
" <input class='portlet-form-input-field'
type='submit' name='submit' value='submit'>\n" +
" </form>\n" +
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-02-05 21:10:46 UTC (rev 9785)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-02-05 21:52:39 UTC (rev 9786)
@@ -127,7 +127,7 @@
<path id="mc.log4j">
<pathelement path="${dependency.log4j.jar}"/>
</path>
- <path id="mc.portal-portlet">
+ <path id="mc.portal-portlet">
<pathelement path="${dependency.portal-portlet.jar}"/>
</path>
<path id="mc.jaxb-api">
@@ -202,7 +202,7 @@
</target>
- <macrodef name="package-misc-test">
+ <macrodef name="package-misc-test">
<attribute name="test"/>
<sequential>
<package-testsuite testsuiteversion="jsr168"
testsuitetype="misc" testsuitename="@{test}"/>
@@ -460,13 +460,13 @@
</target>
- <target name="cargo.setup">
+ <target name="cargo.setup">
<property name="cargo.log.dir"
value="${target}/test/cargo"/>
<mkdir dir="${cargo.log.dir}"/>
<taskdef resource="cargo.tasks">
- <classpath>
- <pathelement path="${plugin_classpath}"/>
- </classpath>
+ <classpath>
+ <pathelement path="${plugin_classpath}"/>
+ </classpath>
</taskdef>
</target>
@@ -579,10 +579,10 @@
<target name="cargo.tomcat-6.start" depends="cargo.setup">
- <taskdef resource="cargo.tasks">
- <classpath>
- <pathelement path="${plugin_classpath}"/>
- </classpath>
+ <taskdef resource="cargo.tasks">
+ <classpath>
+ <pathelement path="${plugin_classpath}"/>
+ </classpath>
</taskdef>
<cargo
@@ -616,7 +616,7 @@
<!--<property name="cargo.jvmargs" value="-Xdebug
-Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9000"/>-->
<deployable type="war"
file="${test.temp.lib}/manager.war"/>
<deployable type="war"
file="${test.temp.lib}/tomcat-6.0/portlet-test.war"/>
- </configuration>
+ </configuration>
</cargo>
</target>
@@ -687,7 +687,6 @@
<delete dir="${target}/simple-portal"/>
<jar jarfile="${target}/portlet-test-lib.jar">
- <!--<fileset dir="${target}/test-classes"/>-->
<fileset dir="${target}/classes"/>
</jar>
@@ -749,10 +748,25 @@
<delete file="${target}/portlet-test-lib.jar"/>
+ <antcall target="package-demo-portlets"/>
</target>
- <!--<target name="package-demo-portlets"
depends="prepare_env">
- <copy
- </target>-->
+ <target name="package-demo-portlets" depends="prepare_env">
+ <copy todir="${test.temp.dir}/google-map-portlet-war">
+ <fileset dir="src/test/resources/google-map-portlet-war"/>
+ <fileset dir="${target}/classes"
includes="org/jboss/portal/simple/samples/GoogleClippingPortlet.class"/>
+ </copy>
+ <jar jarfile="${target}/google-map-portlet.war">
+ <fileset dir="${test.temp.dir}/google-map-portlet-war"/>
+ </jar>
+ <copy todir="${test.temp.dir}/google-weather-portlet-war">
+ <fileset dir="src/test/resources/google-weather-portlet-war"/>
+ <fileset dir="${target}/classes"
includes="org/jboss/portal/simple/samples/*.class"/>
+ </copy>
+ <jar jarfile="${target}/google-weather-portlet.war">
+ <fileset dir="${test.temp.dir}/google-weather-portlet-war"/>
+ </jar>
+ </target>
+
</project>
\ No newline at end of file
Added:
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/portlet.xml 2008-02-05
21:52:39 UTC (rev 9786)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2008, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <portlet-name>GoogleMap</portlet-name>
+
<portlet-class>org.jboss.portal.simple.samples.GoogleClippingPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+
<supported-public-render-parameter>g:zipcode</supported-public-render-parameter>
+ </portlet>
+
+ <public-render-parameter>
+ <identifier>zipcode</identifier>
+ <qname
xmlns:g='urn:jboss:portal:simple:google'>g:zipcode</qname>
+ </public-render-parameter>
+
+</portlet-app>
+
Added:
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/web.xml 2008-02-05
21:52:39 UTC (rev 9786)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2008, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!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/>
+
Added:
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/portlet.xml 2008-02-05
21:52:39 UTC (rev 9786)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2008, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <portlet-name>GoogleWeather</portlet-name>
+
<portlet-class>org.jboss.portal.simple.samples.GoogleWeatherClippingPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+
<supported-public-render-parameter>g:zipcode</supported-public-render-parameter>
+ </portlet>
+
+ <public-render-parameter>
+ <identifier>zipcode</identifier>
+ <qname
xmlns:g='urn:jboss:portal:simple:google'>g:zipcode</qname>
+ </public-render-parameter>
+
+</portlet-app>
+
Added:
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/web.xml 2008-02-05
21:52:39 UTC (rev 9786)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2008, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!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/>
+